你可以这样试试
在appDelegate.m
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
ViewController *vc=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
vc.image=// set your image
vc.message=//message
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:vc animated:YES completion:nil];
}
在ViewController.m
-(void)viewWillAppear:(BOOL)animated
{
[NSTimer scheduledTimerWithTimeInterval:60
target:self
selector:@selector(closeVc)
userInfo:nil
repeats:NO];
}
-(void)closeVc
{
[self dismissViewControllerAnimated:YES completion:nil];
}