Opening Device Settings on Android using Linking

#1

I am trying to open Device settings on Android using

Linking.openURL('app-settings:');

This works perfectly on iOS but on Android it says No Activity found to handle intent.

1 Like
API to open app settings
#2

https://docs.expo.io/versions/v19.0.0/sdk/intent-launcher.html

1 Like
#3

Thanks so much @notbrent

#4

I followed the instructions on the page for intent-launcher. I passed, ACTION_APP_NOTIFICATION_SETTINGS to startActivityAsync. I got a message saying,

The app wasn’t found the in the list of apps.

It looks like the api also requires a map with the key: EXTRA_APP_PACKAGE to be passed in. I tried the name of the app. Do you know what value it would be expecting? I don’t have a standalone app.

Thanks.

#5

Hey,

Were you able to figure out how to pass the extra app package to this API? I am stuck with the same issue.

Also, do you know how to open camera & camera roll permission settings. Can’t seem to find those in the list of the intents defined.

Thanks

#6

Hi,

I was able to make this work by using the following snippet:

IntentLauncherAndroid.startActivityAsync(
  IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS,
  {
    "android.provider.extra.APP_PACKAGE": "paste here your application's package name"
  }
);

Hope it helps,

cheers!

Open notification settings via IntentLauncherAndroid in old Android versions
#7

Hey Sergio,

This works in which android API? ( I tested on API 26 MOTO G 6 and worked)

#8

After a lot of trial and error I managed to get it to work using the third param.

import { IntentLauncherAndroid, Constants } from 'expo'

IntentLauncherAndroid.startActivityAsync(
  IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS,
  {},
  'package:' + Constants.manifest.android.package
)
1 Like
#9

@alastairtaft Surprisingly, your solution works! Thank you so much!