Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
21710850
Commit
21710850
authored
Feb 02, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use unique notification id for PendingIntent
parent
3df7ad16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
app/src/main/java/app/insti/InstiAppFirebaseMessagingService.java
...main/java/app/insti/InstiAppFirebaseMessagingService.java
+3
-3
No files found.
app/src/main/java/app/insti/InstiAppFirebaseMessagingService.java
View file @
21710850
...
@@ -54,11 +54,11 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
...
@@ -54,11 +54,11 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
}
}
/** In case the notification is dismissed */
/** In case the notification is dismissed */
protected
PendingIntent
getDeleteIntent
(
RemoteMessage
remoteMessage
)
{
protected
PendingIntent
getDeleteIntent
(
RemoteMessage
remoteMessage
,
Integer
notificationId
)
{
Intent
intent
=
new
Intent
(
getApplicationContext
(),
NotificationBroadcastReceiver
.
class
);
Intent
intent
=
new
Intent
(
getApplicationContext
(),
NotificationBroadcastReceiver
.
class
);
intent
.
setAction
(
Constants
.
NOTIF_CANCELLED
);
intent
.
setAction
(
Constants
.
NOTIF_CANCELLED
);
intent
.
putExtra
(
Constants
.
FCM_BUNDLE_NOTIFICATION_ID
,
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_NOTIFICATION_ID
));
intent
.
putExtra
(
Constants
.
FCM_BUNDLE_NOTIFICATION_ID
,
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_NOTIFICATION_ID
));
return
PendingIntent
.
getBroadcast
(
getApplicationContext
(),
0
,
intent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
return
PendingIntent
.
getBroadcast
(
getApplicationContext
(),
notificationId
,
intent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
}
}
@Override
@Override
...
@@ -93,7 +93,7 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
...
@@ -93,7 +93,7 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
.
setContentTitle
(
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_TITLE
))
.
setContentTitle
(
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_TITLE
))
.
setContentText
(
message
)
.
setContentText
(
message
)
.
setContentIntent
(
getNotificationIntent
(
remoteMessage
,
notification_id
))
.
setContentIntent
(
getNotificationIntent
(
remoteMessage
,
notification_id
))
.
setDeleteIntent
(
getDeleteIntent
(
remoteMessage
));
.
setDeleteIntent
(
getDeleteIntent
(
remoteMessage
,
notification_id
));
/* Check for article */
/* Check for article */
String
largeContent
=
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_LARGE_CONTENT
);
String
largeContent
=
remoteMessage
.
getData
().
get
(
Constants
.
FCM_BUNDLE_LARGE_CONTENT
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment