简体   繁体   中英

display UIAlert when apps running on background?

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"open app" message:@" backgr..." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

[alertView show];

How could I display alert when apps running background?

Use a UILocalNotification when your app is in the background.

UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"Your message";
notification.alertAction = @"Open app";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM