phonegap-plugin-push event on notification recieved not being fired
See original GitHub issueTrying to get the phonegap-plugin-push working with Capacitor and have some problems.
For starters the project wont build if I first dont in the build.gradle-file change the firebase-messaging version to 17.1.0 instead of 11.6.2. I get the following error with 11.6.2:
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 11.6.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Using 17.1.0 the project is built and the app launches.
let push = PushNotification.init({'android': {}})
push.on('registration', (token) => {
console.log('Token: ' + token)
if (token) {
Device.getInfo().then((result) => {
_this.registerDeviceForPushNotifications(result.platform, token)
})
}
})
push.on('notification', (data) => {
console.log('Notification: ' + JSON.stringify(data))
})
The registration-event is fired after init has been called. When sending a test-notification via my Azure Notification Hub the notification-event isn’t fired. The following two lines shows in the logcat though:
V/Capacitor/Plugin/PushNotifications: Notifying listeners for event pushNotificationReceived
D/Capacitor/Plugin/PushNotifications: No listeners found for event pushNotificationReceived
I’m not using Capacitors PushNotifications-plugin in any way.
Any ideas what’s going on? Starting to hate everything regarding Push Notifications…
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
Yeah, it’s probably that, I don’t think it can work now that Capacitor has it’s own class for
FirebaseMessagingService
You can try removing this
You saved my life. Thank you