I have an app built using Ionic framework & Cordova which uses geo URI to open google maps.
But google maps is not opened. In logs I get following error,
/ActivityManager( 2348): Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
E/DatabaseUtils( 2348): Writing exception to parcel
E/DatabaseUtils( 2348): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
E/DatabaseUtils( 2348): at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
E/DatabaseUtils( 2348): at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
E/DatabaseUtils( 2348): at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
E/DatabaseUtils( 2348): at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
E/DatabaseUtils( 2348): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
E/DatabaseUtils( 2348): at android.os.Binder.execTransact(Binder.java:388)
E/DatabaseUtils( 2348): at dalvik.system.NativeStart.run(Native Method)
I have tried adding following permissions but no luck
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Example URI
'geo:0,0?q=' + 'some address like 2/100 ABC street'
Cordova version - 4.1.2 Android Target SDK - 19
Note: It works fine with Cordova 3.5
Has anyone faced similar issue?
Any help appreciated.
Thanks
cordova 3.6.0+ introduced a external application whitelist. You must add <access origin="geo:*" launch-external="yes" />
to your config.xml .
source: http://cordova.apache.org/docs/en/4.0.0/guide_appdev_whitelist_index.md.html
I haven't really faced that, but the fix seems really simple as you only need to add this permission on your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
Opening external app URIs requires some native code to my knowledge, you can't just do it with an <a href>
link. We solved the problem in Supersonic by implementing a separate API for that: http://docs.appgyver.com/supersonic/api-reference/stable/supersonic/app/openurl/
If you want to check this out, you can use our Steroids tooling to run your Cordova app with our wrapper, though you'll need to include the steroids.js
and supersonic.js
libraries by hand to access the APIs.
(Disclaimer: I'm a programmer at AppGyver).