当应用程序在后台运行时显示 UIAlert? [英] display UIAlert when apps running on background?

查看:68
本文介绍了当应用程序在后台运行时显示 UIAlert?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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?

推荐答案

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

这篇关于当应用程序在后台运行时显示 UIAlert?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆