appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
534 stars 126 forks source link

App does not open on notification tap on Android. #82

Closed ThaHoods closed 6 years ago

ThaHoods commented 6 years ago

Hi, I have an issue with Android, I can receive push notifications on Android and iOS, but when I tap on the notification on Android the app doesn't open. But it works on iOS.

It just close the status bar and clear the notification.

I'm using this options: var data = { title: title, // REQUIRED body: msg, // REQUIRED custom: { sender: title, }, priority: 'high', collapseKey: title, // gcm for android, used as collapseId in apn contentAvailable: true, // gcm for android restrictedPackageName: 'com.package.name', // gcm for android tag: title, retries: 1, // gcm, apn badge: 1, // gcm for ios, apn sound: 'default', // gcm, apn action: 'alert', // apn and gcm for ios topic: 'com.package.name', // apn and gcm for ios category: title, // apn and gcm for ios contentAvailable: '', // apn and gcm for ios expiry: Math.floor(Date.now() / 1000) + 28 86400, timeToLive: 28 86400 };

ThaHoods commented 6 years ago

I discovered that the mistake was mine. I'm using phonegap-plugin-push, and in node-pushnotifications settings i forgot to add phonegap: true . Like this: gcm: { id: KEY, phonegap: true }

I hope this can help someone.