如何在ios中将应用程序带到前台? [英] How to bring application to foreground in ios?

查看:172
本文介绍了如何在ios中将应用程序带到前台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在后台检测到iBeacon。当我的设备进入特定区域时,应用程序应该出现在前台。

I am detecting for iBeacon in background. When my device comes in a particular region application should comes to foreground.

推荐答案

没有用户互动就无法完成。唯一的选择是你可以生成推送通知,告诉用户将应用程序带到前台。

It cannot be done without user interaction. The only option is you can generate a push notification to tell the user to bring the application to foreground.

这是来自 Apple文档关于此问题:


当操作系统提供推送通知(iOS或OS X)
且目标应用程序未在前台运行时,
会显示通知(警报,图标标记号,声音)。如果
是通知警报,并且用户点击或单击操作按钮
(或移动操作滑块),则应用程序启动并调用
方法以传入local-notification对象或远程通知
有效载荷。如果在交付
通知时应用程序在前台运行,则应用程序代理会收到本地
或推送通知。

When the operating system delivers push notification (iOS or OS X) and the target application is not running in the foreground, it presents the notification (alert, icon badge number, sound). If there is a notification alert and the user taps or clicks the action button (or moves the action slider), the application launches and calls a method to pass in the local-notification object or remote-notification payload. If the application is running in the foreground when the notification is delivered, the application delegate receives a local or push notification.

这篇关于如何在ios中将应用程序带到前台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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