Push notification with GCM and $cordovaPush


#1

I’m registering the user and saving the device token to server each time the app starts with this code :

   $cordovaPush.register(config).then(function(result) {
						 
	 alert('reg succ');
	console.log(result);
	deferred.resolve(result);
	 // Success
	}, function(err) {
		alert('reg error');
	})

and i’m sending the notification from the server whit this code :

 var req = {
		 method: 'POST',
		  url: 'https://gcm-http.googleapis.com/gcm/send',
		 headers: {
			Content-Type': 'application/json',
			'Authorization': 'key=xxxx' 
							  },
                                                         
			 data: { 
				"registration_ids": tokens,
				"data" :{
						"image": "htt p://example.com/cool-image.jpg",
						"title": title, 
						"body": msg
				 } 
		 }
	};

Every thing goes fine and i’m receiving all notifications but always the new notification replace the last one on the mobile , how can i keep all the notification ? like collapse