Open notification settings via IntentLauncherAndroid in old Android versions

Hi,

I am trying to send user to the app notification settings screen from my app. The main reason is to let user enable/disable notifications with a direct link from the app.

I am defining an intent activity using the IntentLauncherAndroid of Expo, but based on the first answer of any-way-to-link-to-the-android-notification-settings-for-my-app, it seems that we need to use different definitions for different Android versions.

For the new versions @sergioalvz has found the solution, but has someone been able to do it for old android version (<= 7)?

If we follow the instructions, it could be something like:

IntentLauncherAndroid.startActivityAsync(
  IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS,
  {
    app_package: {PACKAGE_NAME},
    app_uid: {APP_UID},
  }
);

But I have not been able to get app_uid info from Expo to test it. It should be the user id generated by android kernel when the App is installed. Does someone know how to do it with a different approach?

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.