Rin*_*ain 2 objective-c nsnotifications ios localnotification xcode5
从特定时间运行的后台打开我的应用程序..
我想做这样的事情
- (void)applicationDidEnterBackground:(UIApplication *)application
{
timer = [NSTimer scheduledTimerWithTimeInterval:10
target:self
selector:@selector(timerFired:)
userInfo:nil
repeats:NO];
}
- (void)timerFired:(NSTimer*)timer
{
NSLog( @"yes it is running...");
PickUpCallViewController *call=[[PickUpCallViewController alloc]initWithNibName:@"PickUpCallViewController" bundle:nil];
navi=[[UINavigationController alloc]initWithRootViewController:call];
[[navi navigationController] setNavigationBarHidden:YES animated:YES];
window.rootViewController = navi;
[window makeKeyAndVisible];
}
Run Code Online (Sandbox Code Playgroud)
Nit*_*hel 13
当您申请进入后台模式时,无法以编程方式打开应用程序.但是使用URL方案,您可以从浏览器打开App.
您只需将URL方案设置为以下屏幕截图: -




点击"主页"按钮并打开Safari浏览器,保存并最小化您的应用程序.然后输入mytestApp://你在保存之前设置如下截图: -

所有过程都工作正常如下: -

| 归档时间: |
|
| 查看次数: |
1296 次 |
| 最近记录: |