I am developing an app with Backbone JS and XDK.
I need to launch the App comming from an email link going to a path like index.html/#login/kasdjf98458328/expale#example.com/
We are using a route like myapplication://#login/kasdjf98458328/expale#example.com/ but it doesn' t seem to work. It just goes to the app index.html.
I have read that in native Android you need to specify that the app is BROWSABLE
How can I access the app this way using Intel XDK?
Thank you.
To be able to pass parameters to appmobi or xdk app from android uri. Simply use uri schema://index.html?key=value
You can use intel.xdk.device.queryString to recover the parameters.
Related
I'm trying to implement the open with functionality in flutter that allows the user to select the app to open a file with, and that works both in iOS/Android.
The issue I'm facing is that I need to get the installed apps from the device and the plugins I've found don't work in IOS.
These plugins allow me to get installed apps but they only work in Android.
flutter_appavailability
installed_apps
device_apps
This might work for opening the app but I need the exact name.
external_app_launcher,
Contrary to Android, Apple does not provide API to get compatible applications. You will need to make the implementation to show the available apps and launch them yourself. Personally I've already done something similar to open other map applications than Apple Plans so it should definitely be possible.
You can check if a specific application is available by using the package url_launcher and its method canLaunch by trying to launch the URL scheme of an application. For example Google Drive has the URL scheme googledrive:// so if I want to check for Google Drive's availability I will need to do as follow:
import 'package:url_launcher/url_launcher.dart';
bool isAvailable = await canLaunch('googledrive://');
And then I can open it by using the same URL scheme with the needed parameters:
import 'package:url_launcher/url_launcher.dart';
await launch('googledrive://docs.google.com/document/<my_document_url>');
But you will need to define yourself all the applications you are supporting in your application and you will have to create the choice modal dynamically in Flutter depending on the available apps.
I think I've already found the answer, the plugin open_file supports both Android and iOS and a variety of file extensions, you only need to specify the path of the file and it will open with the default app, if you have more than one app able to open the file the OS will show the Open With dialog with the apps.
I've an Android and iOS app with source code. These 2 apps are created by another vendor. I need to use my cordova app to pass in some custom parameters to thesw 2 apps and launch it.
for cordova app, how do we launch native app with parameter ?
Use intent to launch the Android app while use Custom URL Scheme to start the iOS one. Both of them can take parameter.
1 As you have the source code the two apps, you need to edit the androidManifest.xml and info.plist respectively, allowing the native apps to recognize your intention.
2 change the source code for each platform, making them do something special with the parameters.
reference link
Android
https://developer.android.com/guide/components/intents-filters.html
iOS
https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html
I know it's possible to communicate with native android components via the Intent call, but I'm trying to figure out how to launch an app (which is installed) through an Adobe Air application.
Currently, thanks to Ben, I know that...
var url:String = ("intent:#Intent;" +
"action=android.intent.action.MAIN;" +
"category=android.intent.category.LAUNCHER;" +
"component=com.android.settings/.Settings;" +
"end");
navigateToURL(new URLRequest(url));
...launches the Android Settings menu through an Air app, which is awesome.
But I'm trying to launch an app...and I believe the secret lies within the "component=com.android.settings/.Settings;" snippet. Does anybody know how I can modify this code to launch an installed app on a device?
My kingdom for an answer. I've scoured the internet for days searching on this.
Brad
It depends on your use case.
If there's one specific app you want to open, you can look inside that app's .apk for the <intent-filter> elements, as explained in Launch custom android application from android browser. Then craft the appropriate URL to pass to navigateToUrl().
Another possibility is to get the package name for the app you want to open and set that as the component= section of your URL. Fair warning, I'm not actually sure if that will work.
If you don't know what app you want to open at compile-time, it's harder (e.g. if you have a server-side list of applications that your AIR app may need to invoke). Launch an application from another application on Android shows how to launch an application if you only know the package name, but you'll need a native extension to enable that functionality.
I did a Google search for opening spotify URLs/URIs on native app, and found the following URI scheme to open the links in the native app.
spotify://spotify:artist:12Chz98pHFMPJEknJQMWvI
This above link seems to be working fine on ios devices, but i am not able to open this on android device(HTC One). Any suggestions ?
Have you tried entering just the spotify:artist:12Chz98pHFMPJEknJQMWvI in android. I believe the spotify:// may be directing it towards the app, but i think android directs its apps with a different command. Also, just in case it is the same for android, you need to have the app installed on your phone if you dont already have it for the directing command to work properly.
android refer this link
ios refer this link
some reference from above link
have run into a similar need in an app. My solution was to create a client that hits the Spotify API to return either XML or JSON of the search. For instance, if you want Muse, you would hit the API with the following URL:
http://ws.spotify.com/search/1/artist?q=muse
From the XML or JSON, you'll be able to extract the link to the particular artist within their URL scheme:
spotify:artist:12Chz98pHFMPJEknJQMWvI
Chop off the spotify:artist: portion and append that onto a Spotify artist link:
http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI
Then, using the Spotify URL scheme and UIApplication, you can open the Spotify app to that particular artist's page:
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:
#"spotify://http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI"]];
Note, using URL schemes to access features of another app is generally undocumented and can be a fragile endeavor. If Spotify in the future decides to change anything about this, it will break this functionality without warning.
The quick fix I made was to directly call the uri with any modification on the original uri.
which is 'spotify:artist:4gzpq5DPGxSnKTe4SA8HAU' or 'spotify:track:1dNIEtp7AY3oDAKCGg2XkH'
I am making a Hybrid Application using cordova-cli. My requirement is that the first page in my application must redirect to a website. The entire data required for the application will be loaded into this website from some other data-sources.
The requirement is to access device native features such as camera, accelerometer etc. from pages on this website.
I am using
location.href="http://www.example.com";
to open the pages. I need a unified cordova.js file with all the plugins embedded into it.
Currently I am putting the individual plugins into the lib\android\plugin\android and by using the grunt -f command from grunt-cli, the cordova.js file recieved for android does not seem to produce expected results.
Can't be done I am afraid - because of the way Cordova interacts with the device.
What happens if, using a non-mobile device, you accessed the same website from elsewhere? The website will not know what on earth Cordova is.
Cordova interacts with the native code on the device, so requires this to handle the passing of JS-to-native, and vice-versa.