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

[expo-permissions] Fix notification requster #8539

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-permissions/CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@

### 🐛 Bug fixes

- Fixed `Permissions.NOTIFICATIONS` was granted even if notifications were disabled. ([#8539](https://github.com/expo/expo/pull/8539) by [@lukmccall](https://github.com/lukmccall))

## 8.2.0 — 2020-05-27

### 🐛 Bug fixes
Expand Down
Expand Up @@ -19,8 +19,10 @@ class NotificationRequester(private val context: Context) : PermissionRequester
val areEnabled = NotificationManagerCompat.from(context).areNotificationsEnabled()
putString(STATUS_KEY, if (areEnabled) PermissionsStatus.GRANTED.status else PermissionsStatus.DENIED.status)
putString(EXPIRES_KEY, PERMISSION_EXPIRES_NEVER)
putBoolean(CAN_ASK_AGAIN_KEY, true)
putBoolean(GRANTED_KEY, true)
// If notifications aren't enabled, the user needs to activate them in system options. So, we should set `CAN_ASK_AGAIN_KEY` to if this is the case.
// Otherwise, it can be set to true.
putBoolean(CAN_ASK_AGAIN_KEY, areEnabled)
putBoolean(GRANTED_KEY, areEnabled)
}
}
}