Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

PushNotification.hasPermission not working as expected #789

Closed
simonpeters opened this issue Apr 7, 2016 · 2 comments
Closed

PushNotification.hasPermission not working as expected #789

simonpeters opened this issue Apr 7, 2016 · 2 comments

Comments

@simonpeters
Copy link

Expected Behaviour

When running PushNotification.hasPermission I expect to get a boolean back if the user has already given permission or not.

Actual Behaviour

When running PushNotification.hasPermission and the user has not given permission yet, the permission modal popups. This not expected behaviour. I want to be able to ask for permissions later on the app when it makes more sense for the user.

Reproduce Scenario (including but not limited to)

Run PushNotification.hasPermission after deviceready. Before calling PushNotification.init

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 9.3.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

iPhone 6

Cordova CLI version and cordova platform version

Cordova CLI 6.1.0

Installed platforms:
android 5.1.1
browser 4.1.0
ios 4.1.0

Plugin version

phonegap-plugin-push 1.6.1 "PushPlugin"

@simonpeters
Copy link
Author

I found my mistake. I was also using the localNotifications plugin and was not aware the user needed to give permissions for this as well.

Closing issue, but leaving a comment so if someone else has this issue they hopefully find this post.

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant