Commit 1b175a4e authored by Simon MacDonald's avatar Simon MacDonald
Browse files

Issue #48: Multiple push notification problem

parent 4f2386e2
Loading
Loading
Loading
Loading
+3 −1
Changes for src/android/com/adobe/phonegap/push/GCMIntentService.java: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Random;

import org.json.JSONException;
import org.json.JSONObject;
@@ -93,7 +94,8 @@ public class GCMIntentService extends GCMBaseIntentService {
        notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        notificationIntent.putExtra("pushBundle", extras);

        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        int requestCode = new Random().nextInt();
        PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        
        int defaults = Notification.DEFAULT_ALL;