Skip to content

Commit

Permalink
[expo-permissions] Fix notification requster (#8539)
Browse files Browse the repository at this point in the history
* [expo-permissions] Fix notification requster

* [expo-permissions] Update changelog
  • Loading branch information
lukmccall committed May 28, 2020
1 parent e166a8d commit cfd7c80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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)
}
}
}

0 comments on commit cfd7c80

Please sign in to comment.