[TIMOB-25591] Android: Programmatically check whether app has notification permission on Android
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-26T19:50:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | n/a |
Reporter | Motiur Rahman |
Assignee | Yordan Banev |
Created | 2017-12-08T01:25:44.000+0000 |
Updated | 2018-03-22T16:34:58.000+0000 |
Description
In Android settings, users can turn off notification if they don't want to. So need a method that like areNotificationsEnabled() to check if my app is allowed to show a notification. Then need to open android setting page to guide users to turn on the notification.
It's available since 24.1.0 on native Android
https://developer.android.com/reference/android/support/v4/app/NotificationManagerCompat.html#areNotificationsEnabled()
PR: https://github.com/appcelerator/titanium_mobile/pull/9669
7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9858
FR Passed. PR's merged.
Verified the fix in SDK 7.2.0.v20180305152636 & 7.1.0.v20180306061214. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Nexus 6P — Android 8.0.0