Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'user_select' not working on Android #273

Open
AmineMansouriLondon opened this issue Jan 18, 2022 · 3 comments
Open

'user_select' not working on Android #273

AmineMansouriLondon opened this issue Jan 18, 2022 · 3 comments

Comments

@AmineMansouriLondon
Copy link

Attempting to launch navigation with user_select throws 'No supported navigation apps are available on the device' even though 'getAppsForPlatform('android')' displays a whole list of apps including 'user_select'. If a specific app is used, the maps opens fine but user_select doesn't open at all, just throws the error.

Not sure why this is happening but could it be a permissions issue? I believe it was working fine before the move to target SDK 30+.

Plugin version: 4.7.0

Tested on Ionic 2.

@AmineMansouriLondon
Copy link
Author

AmineMansouriLondon commented Jan 24, 2022

For anyone that comes across this issue, it's a permissions problem when targeting Android 11+. Adding:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>

fixes the issue. Have a look here:
Android 11 behaviour changes: https://developer.android.com/about/versions/11/behavior-changes-11

Query/Intent guide: https://developer.android.com/guide/topics/manifest/queries-element

List of permissions: https://developer.android.com/reference/android/Manifest.permission

@F-JJTH
Copy link

F-JJTH commented May 16, 2022

Thanks you for this solution, it works !
To be more precise, we must edit config.xml file like this :

<?xml version='1.0' encoding='utf-8'?>
<widget defaultlocale="fr" id="..." version="..." xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>...</name>
    <description>...</description>
    <author email="..." href="http://ionicframework.com/">...</author>
    <content src="index.html" />
    ...
    <platform name="android">
        <config-file parent="/manifest" target="app/src/main/AndroidManifest.xml">
            <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
            <queries>
                <intent>
                    <action android:name="android.intent.action.SEND" />
                    <data android:mimeType="*/*" />
                </intent>
            </queries>
        </config-file>
        ...
    </platform>
</widget>

@elenche
Copy link

elenche commented Oct 28, 2022

If anyone is using this plugin with Capacitor: you can directly edit AndroidManifest.xml since you probably don't have a config.xml file.

Copy the following code in between the manifest tags:

<queries>
    <package android:name="com.google.android.apps.maps" />
    <intent>
        <action android:name="android.intent.action.SEND" />
    </intent>
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="geo" />
    </intent>
</queries>

Pictured:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants