在我的 XCode 项目中,我使用了如下代码setKeepAliveTimeout
中的方法。applicationDidEnterBackground
- (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];
}];
}
它表明该setKeepAliveTimeout
方法已被弃用,他们想要使用UIRemoteNotificationTypeVoip
方法。
我搜索了UIRemoteNotificationTypeVoip
方法,但没有给出足够的结果。甚至developer.apple.com
没有该方法的文档。
问题:如何更改使用的UIRemoteNotificationTypeVoip
地方setKeepAliveTimeout
?
如果有人知道,请给我一个答案。
提前致谢!