Ionic Stacking notification push using Ionic.io


#1

How could I use stacking using the plugin Ionic.io?

enter link description here

I use this code to send notification:

var req = {
                method: 'POST',
                url: 'https://api.ionic.io/push/notifications',
                headers: {
                    'Content-Type': 'application/json',
                    'Authorization': 'Bearer ' + jwt
                },
                data: {
                    "tokens": val.token,
                    "profile": 'profile',
                    "notification": {
                        "title": titlePush,
                        "message": messagePush,
                        "android": {
                            //  "notId": "1",
                            "icon": "ic_logo",
                            "iconColor": "#ee9425",
                            "image": val.image,
                           /* "payload": {
                                "style": "inbox",
                                "summaryText": "vous avez reƧu %n% notification"
                            },
                            "style": "inbox",
                            "summaryText": "There are %n% notifications",*/
                            "stack": 3,
                            "data": {
                                "style": "inbox",
                                "summaryInbox": "inbox",
                                "notId": Math.floor((Math.random() * 100) + 1)
                            },
                            "payload": {
                                "custom_app_thing": "yes"
                            },

                            "title": titlePush,
                            "message": messagePush
                        },
                        "ios": {
                            "title": titlePush,
                            "message": messagePush
                        }
                    }
                }
            };

            // Make the API call
            $http(req).success(function (resp) {
                // Handle success
                console.log("Ionic Push: Push success", resp);
                var refmypush = ref.child('push').child(snapshot.key());
                refmypush.remove();
            }).error(function (error) {
                // Handle error 
                console.log("Ionic Push: Push error", error);
            });

When I send notifications I see only the last it.

I want, when I send multi notifications, all messages can be seing like hangout.

example:


#2

Could you manage to do this ? I met the same issue.
Seem like the notId payload not work with Ionic Push ?


#3

I found the resolution here :smile: