cordovapush-notificationibm-mobilefirstcordova-pluginsrichpush

Promotional pushnotification with image in IBM mobile First 8.0


We are working on Hybrid Mobile applicaiton,(IBM Mobilefirst8.0,IONIC3.0,Angular4.0), We are tring to send promotional push notificaiton (push notifciation with image),We are able to send pushnoticaiton with text but unable get image ,

what we tried below:

{  
   "message":{  
      "alert":"Picture Notification from MFP console ",
      "url":"http://www.sfshjdf.com"
   },
    "priority" : "high"

   "target":{  

      "userIds": ["MyUserId", ...]
   },
   "settings":{  
      "gcm":{  
         "style":{  
            "notification_type":"PICTURE_NOTIFICATION",
            "url":"https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
            "title":"Test Picture Notification"
         },
      "apns": {
         "attachmentUrl" : "https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
         "payload" : {
                "title": "test Sampele",
        "url": "https://www.gsdfh.com"
        }

        }
      }
   }
}

what we are getting :

we got text message "Picture Notification from MFP console" but the image is not displyed in notiffication message. we are expecting notification with image what we are pass in Settings option. if some one guide to us ,what we missed


Solution

  • The payload used to send notification is not correct. Here is the correct payload structure to send,

        { 
          "message":{ 
             "alert":"Picture Notification from MFP console ",
             "url":"http://www.sfshjdf.com"
               },
          "target": {
                   "userIds": ["MyUserId", ...]
               },
          "settings":{ 
             "gcm":{ 
                "style":{ 
                   "notification_type":"PICTURE_NOTIFICATION",
                   "url":"https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
                   "title":"Test Picture Notification"
                },
              },
             "apns": {
                "attachmentUrl" : "https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
                "payload" : {
                     "title": "test Sampele",
                     "url": "https://www.gsdfh.com"
               }
              }
             }
          }
    

    Please try above payload JSON. Thanks.