ios 8 openUrl itms-services does not exit current app

前端 未结 3 551
长发绾君心
长发绾君心 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: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.

提交回复
热议问题