Skip to content

Commit ce45bc8

Browse files
mkuklisEddyVerbruggen
authored andcommitted
Added support for defaults.
1 parent c2c6271 commit ce45bc8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/android/com/plugin/gcm/GCMIntentService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,17 @@ public void createNotification(Context context, Bundle extras)
9090

9191
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
9292

93+
int defaults = Notification.DEFAULT_ALL;
94+
95+
if (extras.getString("defaults") != null) {
96+
try {
97+
defaults = Integer.parseInt(extras.getString("defaults"));
98+
} catch (NumberFormatException e) {}
99+
}
100+
93101
NotificationCompat.Builder mBuilder =
94102
new NotificationCompat.Builder(context)
95-
.setDefaults(Notification.DEFAULT_ALL)
103+
.setDefaults(defaults)
96104
.setSmallIcon(context.getApplicationInfo().icon)
97105
.setWhen(System.currentTimeMillis())
98106
.setContentTitle(extras.getString("title"))

0 commit comments

Comments
 (0)