Comments (9)
@natanaelmaia Sounds like a bug. Can you give me a more detailed reproduction scenario so when I have time to look at this I can go right to the problem?
from phonegap-plugin-push.
@macdonst, I sent two push notifications to the app. The first one with notId=0 and the last one with notId=1. When I tapped the first notification sent (notId=0), the push.on(’notification’) function was called with notId=1. The other notification also had disappeared from status bar.
This only happend in Android.
Thanks!
from phonegap-plugin-push.
Seems like this tracks back to this issue where @sinedied mentions that creating different notIds
only makes showing multiple notifications possible, not handling them all accordingly. We need to inform a different requestCode
for each notification for them to be able to trigger different actions. This behaviour is described in details here:
If you truly need multiple distinct PendingIntent objects active at the same time (such as to use as two notifications that are both shown at the same time), then you will need to ensure there is something that is different about them to associate them with different PendingIntents. This may be any of the Intent attributes considered by Intent.filterEquals, or different request code integers supplied to getActivity(Context, int, Intent, int), getActivities(Context, int, Intent[], int), getBroadcast(Context, int, Intent, int), or getService(Context, int, Intent, int).
Changing https://github.com/phonegap/phonegap-plugin-push/blob/master/src/android/com/adobe/phonegap/push/GCMIntentService.java#L96 from
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
to
int requestCode = new Random().nextInt();
PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
fixes it.
Please take a look into it! Looking forward to 1.1.2 with this!
from phonegap-plugin-push.
You guys are the best. I may get a chance to look into this tonight.
from phonegap-plugin-push.
@fredgalvao thanks, I tested and merged your change today. It'll show up in the next plugin release officially bug you can clone this repo to get the latest.
from phonegap-plugin-push.
I appreciate the quick response, and I'm glad I could help!
Now onto that bigText thing on android...
from phonegap-plugin-push.
I am having notifications with different notId and when I select a notification the corresponding actions are executed correctly, But other notifications with different notIds are disappearing from notification tray in android when app is in foreground
from phonegap-plugin-push.
@VaishaliRavindran Have you tried reading/changing the value of android.clearNotifications
on your init options?
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#android
Also, if your issue persists, please create a new issue, as your case is not really the same as this issue. (edit) I see you have indeed created a new issue, so please ignore this last paragraph.
from phonegap-plugin-push.
This thread has been automatically locked.
from phonegap-plugin-push.
Related Issues (20)
- Callbacks (hasPermission, register) are not called on iOs 13 HOT 3
- @parmarkaushik15 yeah, like I said in my last comment, if the app is forced closed there is no web view in memory to run the JS. The best you can do at this point is look into using the force start parameter. HOT 1
- ios: notification event not firing after app is closed when user opens app directly - works on android HOT 1
- On notification event not firing when cordova local notification plugin is installed. HOT 5
- IOS. Does not show 'Allow / Deny' notification dialog and not receiving push notification
- Blank screen is displayed in few devices instead of picture
- iOS13 APNS Device Token HOT 2
- getNotificationSettingsWithCompletionHandler - completion handler never executes on iOS 9.3.5
- Incompatibilty phonegap-plugin-push whit cordova-plugin-googlemaps HOT 5
- Unable to send push to browser(Firefox, Chrome) using fcm/gcm getting 'InvalidRegistration'
- On Android it receives notifications but they don't appear on Firebase Analytics
- Not every key in the firebase's {android/ios}.notification object is supported in "additionalData" object
- Unable to compile 2.3.0
- HELP - Failed to install 'phonegap-plugin-push': undefined - cocoapods -macOs Catalina HOT 1
- registration is not called
- iOS: Can't process background notification on low battery
- Security Error with android:exported=true
- [Android] on('notification') 'coldstart' value is acting wacky and not as documented (works only on iOS)
- Sporadic registrations on iOS using Xcode
- FCM version is not up-to-date.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonegap-plugin-push.