Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Stacked notification Required

$
0
0

@Dhyanandra wrote:

hi,
I am developing android app using ionic and want stacked notification but every new notification just overrides old one.

//client side code
$ionicPlatform.ready(function() {
$ionicPush.init({
"debug": true,
"onNotification": function(notification) {

                    var payload = notification.payload;
                    console.log(notification, payload);
                    alert("notification   "+JSON.stringify(notification));
                },

                "onRegister": function(data) {
                    alert(data.token);
                    var parentId = "70";
                    $scope.saveGcmToken( parentId, data);
                },

                "pluginConfig":{
                    "android":{

                        'badge'      : true,
                        'sound'      : true,
                        'alert'      : true,
                        "icon"       :"icon",
                        "iconColor": "#948438"
                    },

                }
            });

            $ionicPush.register({
                    canShowAlert: true, //Can pushes show an alert on your screen?
                    canSetBadge: true, //Can pushes update app icon badges?
                    canPlaySound: true, //Can notifications play a sound?
                    canRunActionsOnWake: true, //Can run actions outside the app,
           });

});

//server side
POST /push/notifications HTTP/1.1
Host: api.ionic.io
Content-Type: application/json
Authorization: Bearer token
Cache-Control: no-cache

{
"tokens": "token",
"profile": "profile",
"notification": {
"title": "testing ionic notification",
"message":"hi"
},
"android": {
"count":"5",
"priority":"high",
"data": {
"title": "testing ionic notification",
"message":"hi",
"style": "inbox",
"summaryText": "you have %n% notifications"
},
"sound": "android-sound.wav",
"icon": "icon",
"iconColor": "blue",
"image": "ionitron.png",
"stack": 2

}

}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>