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

issue: crashed when opening app notifications settings in System Settings #10

Open
typ-AhmedSleem opened this issue Feb 3, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@typ-AhmedSleem
Copy link

typ-AhmedSleem commented Feb 3, 2025

Hi!
I used your library and found it so handy and straight forward but my app crashed when I tried to push a TOP notification.

Issue description:
In your android target, when notifications is disabled then you request to open notification settings to inform user to enable notifications. In this part of code especially the code below:

private fun openNotificationSettings(context: Context) {
    val intent = Intent().apply {
        action = Settings.ACTION_APP_NOTIFICATION_SETTINGS
        putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
    }
    context.startActivity(intent)
}

the code is fine but missing one thing, The Activity intent flag 'FLAG_ACTIVITY_NEW_TASK' as result of calling the activity from outside an activity context.

Solution steps:
Add the required flag to the requesting intent to solve this issue.

Thanks :)

@KhubaibKhan4 KhubaibKhan4 self-assigned this Feb 3, 2025
@KhubaibKhan4 KhubaibKhan4 added the bug Something isn't working label Feb 3, 2025
@KhubaibKhan4
Copy link
Owner

Thank you @typ-AhmedSleem. I'm just busy now a days. Will update all the libs soon. Thank you for your suggestions again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants