ios 8 openUrl itms-services does not exit current app

前端 未结 3 540
长发绾君心
长发绾君心 2020-12-14 19:05

In iOS 6 or 7, the app exit to the home screen when I call UIApplication openUrl with a url of itms-services://XXXX to install a new version of my app (using en

相关标签:
3条回答
  • 2020-12-14 19:24

    Yes, you also get the same behaviour when clicking a download link in safari now on iOS8.

    I'm not sure why they introduced this change but there isn't really a way around it (unless you force your app to crash with something like exit(0);)

    Also, the itms-services url scheme is undocumented and is technically a private api. From experience, you're not allowed to submit apps to the App Store that use it.

    0 讨论(0)
  • 2020-12-14 19:30

    I have experienced a similar thing. I have a web page for our internal app store and when I tap on the link I do get a prompt asking if I want to install and when I say yes safari just sits there. The app is downloading on the home screen but under IOS 7 safari would be pushed to the background and you could see where your app is being downloaded to and its progress. Now it appears like nothing is happening. I would love to correct this. Perhaps something has changed in the .plist files the itms-services protocol uses. This protocol is not private it is just reserved for enterprise deployments.

    0 讨论(0)
  • 2020-12-14 19:34

    While forcing the app to crash will technically work, a much better solution (allowing the user to retain the state of the application) would be to simply background the app launching the itms-services link by executing the following.

    [[UIApplication sharedApplication] performSelector:@selector(suspend)];
    

    We use this in an app used for distributing test builds to our testers and it works very well, and eliminates the confusion of a tester trying to install an app and having the app stay in front. It also allows them to return to our distribution app and have it pick up where they were.

    0 讨论(0)
提交回复
热议问题