In my XCode project, i have used setKeepAliveTimeout
method in applicationDidEnterBackground
method like below code.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
[self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
[application setKeepAliveTimeout:600 handler: ^{
[self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
}];
}
It shows that setKeepAliveTimeout
method is deprecated and they wants to use UIRemoteNotificationTypeVoip
method.
I searched for UIRemoteNotificationTypeVoip
method, but not enough results are given. Even developer.apple.com
doesn't have documentation for that method.
Problem: How to change UIRemoteNotificationTypeVoip
where setKeepAliveTimeout
is used?
If anyone knows, then give me an answer.
Thanks in Advance!
Use below structure to achieve your task.
Some reference
https://github.com/hasyapanchasara/PushKit_SilentPushNotification
Use this simplepush.php file
Use below commands to create pem file and use it in above code.
After that go to simplepush.php location and fire command -> php simplepush.php
This way you can test your push kit notification setup architecture.
https://zeropush.com/guide/guide-to-pushkit-and-voip
https://www.raywenderlich.com/123862/push-notifications-tutorial
Download
Through pushkit payload you can schedule local notification. when pushkit payload comes your app will active in background or terminated state upto your local notification sound plays. you can also keep details in NSUserDefault. so on interactive local notification or didfinishlaunching with option you can do whatever you want.