当App在iOS中处于后台时,openURL无效 [英] openURL is not working when App is in background in iOS

查看:591
本文介绍了当App在iOS中处于后台时,openURL无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在应用程序处于后台时,我试图在我的应用程序中打开Safari中的一个URL,下面是我的代码

I am trying to open one URL in Safari from my App when App is in background, below is my code

    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:strURL]];

我的应用程序在调试过程中点击上面一行,但没有用给定的URL打开Safari。

My App is hiting the above line during debugging, but not opening Safari with the given URL.

推荐答案

这是不可能的,你不能从后台状态启动另一个应用程序。如果应用程序在后台,则您无法在iPhone / iPad屏幕上处理任何活动以处理您的应用事件。你必须要唤醒你的应用程序。您可以使用本地通知。

It's not possible, You cannot launch another app from the background state. If app in background then you can't have any event for handle your app event from iPhone/iPad screen. You must have to wake up your app. You can use local notifications.

这篇关于当App在iOS中处于后台时,openURL无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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