简体   繁体   中英

iOS show UIAlert when app is running in background

在此处输入图片说明

Is there a way for an app running in the background to display/schedule this kind of alert dialog?

EDIT: I know about push notifications, I'm looking for something more intrusive.

It is not possible to add or modify layout outside of your app. The possibilities you have are limited to local and push notifications.

These notifications can be set to "alert" by the user, so that they are intrusive. But there is no way to set that by yourself.

You could schedule a local/remote notification as the app enters the background. Maybe even in response to a background fetch or something like that. you cannot present UI to foreground yourself when in the app is in background.

See the Local and Remote Notification Programming Guide

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