openURL is not working when App is in background in iOS

末鹿安然 提交于 2019-12-07 08:04:24

问题


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

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


回答1:


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.



来源:https://stackoverflow.com/questions/25132931/openurl-is-not-working-when-app-is-in-background-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!