bug: PushNotifications is missing the removeAllListeners function
See original GitHub issueBug Report
Capacitor Version
npx cap doctor
output:
Installed Dependencies:
@capacitor/core 1.5.1
@capacitor/cli 1.5.1
@capacitor/android 1.5.2
@capacitor/ios 1.5.2
[success] Android looking great! 👌
Found 4 Capacitor plugins for ios:
capacitor-fcm (2.0.0)
cordova-plugin-add-swift-support (1.7.2)
cordova-plugin-file (6.0.2)
cordova-plugin-photo-library (2.2.1)
[success] iOS looking great! 👌
Affected Platform(s)
- Android
- iOS
- Electron
- Web
Current Behavior
-
PushNotifications.removeAllListeners
is not a function. -
PushNotifications.requestPermissions
returns an empty object.
Expected Behavior
-
Removes all listeners.
-
Returns an object with
granted
property.
Sample Code or Sample Application Repo
PushNotifications.removeAllListeners();
Other Technical Details
When I do console.log(Object.keys(PushNotifications))
, I get only:
[
"addListener",
"listChannels",
"removeDeliveredNotifications",
"createChannel",
"getDeliveredNotifications",
"requestPermissions",
"removeAllDeliveredNotifications",
"deleteChannel",
"register"
]
But in the docs, there is a removeAllListeners
method?
npm --version
output:
6.13.1
node --version
output:
v13.2.0
pod --version
output (iOS issues only):
1.8.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Push Notifications Capacitor Plugin API
On iOS, the first time you use the function, it will prompt the user for push notification permission and return granted or denied...
Read more >App Missing from Settings -> Notifications list - Apple Developer
We are receiving myriad complaints from members that our app is now missing from Settings -> Notifications, and so our members cannot receive...
Read more >Javascript removeEventListener not working - Stack Overflow
Your removeEventListener 's argument is not a reference to the function object that was previously attached. function foo(event) { app.addSpot(event.clientX, ...
Read more >Beginners guide to Web Push Notifications using Service ...
In this post we will look at how to implement push notifications for the web… ... Error DOMException: Registration failed - missing ...
Read more >Handling Events in Node.js with EventEmitter - Stack Abuse
They both have the same effect. removeAllListeners(). Again, as the name suggests - this function will remove all listeners from all events of ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In capacitor 1 calling
register
also requested the permission, but doesn’t do it in Capacitor 2.But please, don’t keep asking questions on github issues.
For questions you can ask on the forum, slack or stack overflow using capacitor tag.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.