且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当应用程序在后台运行时显示 UIAlert?

更新时间:2022-12-27 10:37:33

使用 UILocalNotification 当您的应用在后台时.

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];