I am trying to send an image along with notification from my backend code, i need to dispaly it in UI. I am not using service extension, and i am using UserNotificationCenterDelegate. i dont want as it is given in below url:
this is my code:
public override void DidReceiveRemoteNotification(
UIApplication application,
NSDictionary userInfo,
Action completionHandler)
{
NSDictionary aps = userInfo.ObjectForKey(new NSString("aps")) as NSDictionary;
NSDictionary DetailedInfo = aps.ObjectForKey(new NSString("alert")) as NSDictionary; NSDictionary custom = userInfo.ObjectForKey(new NSString("custom")) as NSDictionary; var messageTitle = new NSString("title"); var messageBody = new NSString("body"); var orderid = new NSString("orderid"); var pagetonavigate = new NSString("page"); var notificationDBid = new NSString("notificationDbId"); LinkNavigation linkNavigation = new LinkNavigation(); string message = null, orderId = null,page=null,notificationid = null; if (DetailedInfo.ContainsKey(messageBody)) { message = (DetailedInfo[messageBody] as NSString).ToString(); } if (custom.ContainsKey(orderid)) { orderId = (custom[orderid] as NSString).ToString(); if (!string.IsNullOrEmpty(orderId)) { linkNavigation.OrderId = orderId; } else linkNavigation.OrderId = null; } if (custom.ContainsKey(pagetonavigate)) { page= (custom[pagetonavigate] as NSString).ToString(); if (!string.IsNullOrEmpty(page)) { linkNavigation.Pagename = Convert.ToInt16(page); } } if (custom.ContainsKey(notificationDBid)) { notificationid = (custom[notificationDBid] as NSString).ToString(); if (!string.IsNullOrEmpty(notificationid)) { NotificationReadUnread(long.Parse(notificationid)); } } if (!string.IsNullOrEmpty(orderId) || !string.IsNullOrEmpty(page)) { LoadApplication(new App(linkNavigation)); } }
Thanks in adv.