objective c - IOS voip app with Push kit -
i working voip app using push kit framework. have issues related delivery of remote notification.
issues
1) notification messages send when device turned off lost permenantly
2) after restarting device, no push notification messages recieved unless application started again
i have enabled voip on ip, background fetch, remote notification capabilities , checks notification available on
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsdictionary* payload = [launchoptions objectforkey:uiapplicationlaunchoptionsremotenotificationkey]; if (payload) { // process payload here nslog(@"there notifications available processing"); } }
i have overrided following methods
//pushkit notification alerts methods - (void)pushregistry:(pkpushregistry *)registry didupdatepushcredentials:(pkpushcredentials *)credentials fortype:(nsstring *)type{ if([credentials.token length] == 0) { nslog(@"voip token null"); return; } nslog(@"pushcredentials: %@", credentials.token); } - (void)pushregistry:(pkpushregistry *)registry didreceiveincomingpushwithpayload:(pkpushpayload *)payload fortype:(nsstring *)type{ [self showlocalnotification:[[payload dictionarypayload] valueforkey:@"data"]]; }
its works fine when app foreground , when goes background. receives messages when user forcibly quits application.
testing platform os version : ios 8.1 , above devices:iphone 5c,iphone 5s,iphone 6, iphone 6+
according apns guides, messages stored in apns when target device offline, , apple store recent message per app, means other messages discarded.
see store-and-forward section here: https://developer.apple.com/library/content/documentation/networkinginternet/conceptual/remotenotificationspg/apnsoverview.html#//apple_ref/doc/uid/tp40008194-ch8-sw1
Comments
Post a Comment