How to send the promotional image in the push notification as it is like the below image? Do I need to use any html code in payload? If possible kindly share the code snippet.
Asked
Active
Viewed 261 times
0

James Z
- 12,209
- 10
- 24
- 44

Raghavendra Rao
- 130
- 9
-
Please check this answer https://stackoverflow.com/a/50523908/5084797 – manishsharma93 Jul 18 '18 at 08:07
1 Answers
0
Edit April 2019:
IBM MobileFirst 8.0 supports sending rich push notifications. Update to the latest server and client side fix packs to get the feature. Use the following payload structure when dispatching Push:
Push payload:
{
"message":{
"alert":"Picture Notification for Android devices ",
"url":"http://www.test.com"
},
"target":{
"deviceIds": ["MyDeviceId1", ...],
"platforms": ["A,G", ...],
"tagNames": ["Gold", ...],
"userIds": ["MyUserId", ...]
},
"settings":{
"gcm":{
"style":{
"notification_type":"PICTURE_NOTIFICATION",
"url":"<URL of the image that needs to be displayed>",
"title":"Test"
},
"apns": {
"attachmentUrl" : "http://test.com/test.png",
"badge" : 1,
"category" : 1,
"iosActionKey" : "Ok",
"launchImage" : "test.png",
"locArgs" : [ "["Shelly"]", ... ],
"locKey" : "REQ_FORMAT",
"payload" : {"custom":"data"},
"sound" : "song.mp3",
"subtitle" : "Sub Title",
"title" : "Title",
"titleLocArgs" : [ "["Shelly"]", ... ],
"titleLocKey" : "REQ_FORMAT",
"type" : "SILENT"
}
}
}
}

Vivin K
- 2,681
- 1
- 11
- 14