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

Feature: Possible to open notification settings on Android #30

Open
sivo1981 opened this issue Nov 15, 2024 · 0 comments
Open

Feature: Possible to open notification settings on Android #30

sivo1981 opened this issue Nov 15, 2024 · 0 comments

Comments

@sivo1981
Copy link

Currently for Android it is only possible to open default settings. Is it possible to add option to open notification settings.

Snippet code taken from ChatGPT:

        const context = Utils.android.getApplicationContext()
        const intent = new android.content.Intent()
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
          intent.setAction(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
          intent.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, context.getPackageName())
        } else {
          intent.setAction(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
          const uri = android.net.Uri.fromParts('package', context.getPackageName(), null)
          intent.setData(uri)
        }
        intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)
        context.startActivity(intent)
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

1 participant