Mayur  Gujrathi

Mayur Gujrathi

  • 409
  • 3.9k
  • 1m

sending notification failed with payload in c#

Aug 4 2017 2:26 AM
I am trying to send notification on Iphone with payload which is getting failed ..same code is working fine without payload
  1. AppleNotificationPayload p = new AppleNotificationPayload();  
  2. p.AddCustom("clientcode""sdfsdfsdf");  
  3. p.AddCustom("lotId""sdfdsfsdf");  
  4. p.AddCustom("productCode""sdfsdffsd");  
  5.   
  6. String gcm_token = dtnoti_GcmList.Rows[r]["gcmToken"].ToString().Trim();  
  7. String DeviceType = dtnoti_GcmList.Rows[r]["deviceType"].ToString().Trim();  
  8. push.QueueNotification( new AppleNotification()  
  9. .ForDeviceToken(Convert.ToString(dtnoti_GcmList.Rows[r]["gcmToken"]))  
  10. .WithAlert(Convert.ToString(message))  
  11. .WithBadge(1)  
  12. .WithContentAvailable(1)  
  13. .WithPayload(p)  
  14. .WithCategory(Convert.ToString("TradingVivekamAlert"))  
  15. .WithSound("sound.caf"));  
when i remove .WithPayload(p) it works fine

Answers (1)