Ion icon after push notification

I am using IONICFramework and I would like to set the icon of my application after I receive a push notification.

Is there any way to do this when my application is closed?

+4
source share
2 answers

I had the same problem resolving this by removing the POST URL from the postman instead of the user interface specified on apps.ionic.io and it worked

0
source

this is for others who will face the same problem. I believe that you are talking about making the icon visible with the updated icon number that you received from the server.

, init Push,

var push = PushNotification.init({
                android: {
                    senderID: senderID,
                    icon: 'pushicon',
                    sound: "true",
                    iconColor: "#ED8B00"
                },
                browser: {
                    pushServiceURL: 'url'
                },
                ios: {
                    alert: "true",
                    **badge: "true",**
                    sound: "true"
                },
                windows: {}
            });

{ iPhone Android}

. ios, updatd, .

ios, , android ;

 {
    "aps": {
        "alert": {
            "title": "Received",
            "body": "You have received a message from Kens"
        },
        "badge": 66
    },
    "received_id": "9223",
    "pn_type": "RECEIVED"
}

, ( ).

, .

0

Source: https://habr.com/ru/post/1616116/


All Articles