I am writing an app using PhoneGap framework. The main screen has four buttons and if I click the first button, a native app that has been written to show a Map in MapKit should execute. How to invoke this app from a javascript call?
Any thoughts?
Yes, you need to write a plugin for that feature.
For calling a external .xib you can look at some of the code from the ChildBrowser plugin.
There is also a MapKit plugin available:
you can do this by using the plugin architecture of phonegap.
Here is the wiki entry for writing phonegap plugins for iOs: http://wiki.phonegap.com/w/page/36753496/How%20to%20Create%20a%20PhoneGap%20Plugin%20for%20iOS
Related
I'm building an app in NativeScript {N} where I'm implementing a webview.
All of this is working fine, but in my webpage, I would like to get some JS debug statements. How can I see the webview console.log output?
Previously I was able to "inspect" it through Safari, but that option is not presented in the "Develop" menu anymore.
If like me you could not figure out how to do this using the webview proivded by nativescript you'll need to install this plugin to get what you need.
https://github.com/shripalsoni04/nativescript-webview-interface
I provides a lot more features more than the stock. Basically, it allows you to emit events to the android from the webview layer. The author provides a good tutorial on this.
Say I build a super mobile friendly web application that I want in the Play Store for Android users to be able to download.
Could I use Xamarin to:
Wrap the entire mobile app as a single WebView
Register for mobile push notifications
Essentially shortlining an MVP of an android app by using an existing web app? If so, is there any well-known process or documentation that demonstrates this?
Probably the best approach for you would be using Xamarin Forms with one or more pages containing only web views.
I don't love Xamarin Forms because usually for me Xamarin Android+iOS gives a better result in similar time, but your app would be so simple that doesn't make sense to do it with Xamarin Android.
Make sure that your web app will show only what makes sense to be shown in your app, otherwise you risk to see double header/footer, useless buttons... but if the website is yours adding a few parameters to change a bit the UI won't be a problem I guess.
Have a look at this example:
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithWebview
Another approach is the use of Razor to build your pages in html directly inside your app, but if I understood well it's not what you need:
https://developer.xamarin.com/guides/cross-platform/advanced/razor_html_templates/
Although it is technically possible to do this as the previous answer has suggested. I would recommended firstly reviewing, the relevant stores guidelines on submissions. Apple for example will not allow a submission to their store of any application that simply mirrors the functionality of a website. I suspect Google's would likely be the same.
However that said, to answer your question, Xamarin.Forms would be appropriate for a simple application like the one you are suggesting. Or if you prefer to build to a specific OS, then in iOS with Xamarin you would use the Safari View Controller that was added in it's xcode 8.1 release. Android uses something similar as does windows.
EDIT:
You can use the Web View control in Xamarins Andorid native PCL project to encapsulate your mobile friendly website within an application here is the documentation:
Xamarin Android Developer link to Android Web View
As for push notifications, yes this is perfectly possible using Xamarin.Android. and varies on implementation depending on what you want to use as the back end to handle them, I.E. Azure's notification hub etc.
I'm building an app, and I was curious if there's a way to open the app when you're on the website through the iOS Safari extension. So, if I'm on a post I'd tap the app icon in the share sheet and I'd pass that to the app to load the post in the app.
I know the Bing app can translate the current website and inject directly into the DOM, so I was wondering what custom logic you can implement.
There's really no way to open the app from this kind of extension. Extensions can't access [UIApplication sharedApplication], so they can't call openURL:. There's an openURL:completionHandler: method on NSExtensionContext, but it only works in "today" extensions. Share extensions can display a fully custom UI and can save data that's available to their containing app, but they can't actually open that app.
I have an application and I'm going to add a widget to it to show the containing app's summary data. Is there any way to use containing app's classes and methods in today extension app?
How should I get the widget's data from my main app?
thanks alot
You could use '''NSUserDefaults''' with app groups
How can this be done with Phonegap? Is this even possible?
See this post for an image of what I'm looking for:
iPhone Camera - Choose from Library or Take Photo
EDIT:
There's a plugin for this
https://github.com/purplecabbage/phonegap-plugins/tree/master/iPhone/NativeControls
This is something I have achieved by using Sencha-Touch
See the demo here (User Interface > Overlays > Action Sheet)
See the API : http://docs.sencha.com/touch/1-1/#!/api/Ext.ActionSheet
[EDIT]
You can also use this PhoneGap plugin :
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/ActionSheet