FIX: Android background permission check does not work.#32
Open
gahms wants to merge 2 commits intoVanethos:masterfrom
Open
FIX: Android background permission check does not work.#32gahms wants to merge 2 commits intoVanethos:masterfrom
gahms wants to merge 2 commits intoVanethos:masterfrom
Conversation
Use Activity for requestNotificationPermissions which will only make sense in the foreground and use Context for getNotificationPermissionStatus which can also be used during a background task, such as handling a (silent) push notification.
Owner
|
@gahms I was reading the documentation for the registrar, and in this case does it make more sense to use the |
Author
|
Yes! You are totally right. I have no idea why I looked at |
Author
|
Android Studio tells me I should upgrade the Gradle Plugin used and I am guessing Travis fails due to the use of an old Gradle Plugin - should I upgrade and commit to this PR, open a new PR or just ignore? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During background operations, the
Contextreceived withRegistrar.activity()is null. This is also in the doc forRegistrar.activity().The solution is to use an
Activity(Registrar.activity()) forrequestNotificationPermissions, which will only make sense in the foreground and use aContext(Registrar.context()) forgetNotificationPermissionStatuswhich can also be used during background tasks, such as handling a (silent) push notification.