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

Ionic push notification with icon

$
0
0

@totofe wrote:

Hi,

I try to send a push notification with ionic.io :

http://docs.ionic.io/docs/push-sending-push

I use this code :
var req = {
method: 'POST',
url: 'https://api.ionic.io/push/notifications',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + jwt
},
data: {
"tokens": tokens,
"profile": 'profile',
"notification": {
"title": titlePush,
"message": messagePush,
"android": {
"title": titlePush,
"message": messagePush,
"icon": "img/logo.png",
"data": {
"image": "img/logo.png"
}
},
"ios": {
"title": titlePush,
"message": messagePush
}
}
}
};

                // Make the API call
                $http(req).success(function (resp) {
                    // Handle success
                    console.log("Ionic Push: Push success", resp);
                }).error(function (error) {
                    // Handle error
                    console.log("Ionic Push: Push error", error);
                });
            }

And I receive this notification:

So, how I do to send my logo in notification?

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49076

Trending Articles



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