UIApplication openURL background

前端 未结 3 1631
情歌与酒
情歌与酒 2020-12-06 07:25

In my iOS 4 application, I need to open a URL from the background, at a time specified from the user. However, for some reason, I cannot launch a URL from the background fo

3条回答
  •  Happy的楠姐
    2020-12-06 07:40

    UIKit calls can only run on the main thread. I think that because this is running on a background thread, Safari still visits the URL, but your app is still active. Try opening Safari shortly after and see if it loaded the URL.

    The solution would be to put this on the main thread, and thus leave your app at the time that code is run. That doesn't sound like what you want it to do, sorry. If you want to visit the URL from within your app you can present an UIWebView.

提交回复
热议问题