简体   繁体   English

再次启动ipad应用

[英]launch the ipad app again

when user presses home button the app should relaunch or it should not allow user to terminate. 当用户按下主屏幕按钮时,该应用应重新启动,或者不允许用户终止。 what is the possible way to do this? 可能的方法是什么? The app should remain on ipad unless user quits the app from inside the application not from home button. 除非用户从应用程序内部而不是从主页按钮退出应用程序,否则该应用程序应保留在ipad上。

I am considering the termination of app if it crashes or some other reasons that is ok app should quit no doubt, but not normally as user press home button the app should relaunch. 我正在考虑终止应用程序的崩溃,如果崩溃或其他一些可以确定的原因,应用程序无疑应该退出,但是通常不应该这样做,因为用户按下主页按钮后,应用程序应该重新启动。

There is no way to do this. 没有办法做到这一点。 It would be a horrible user experience anyways, and as such, not encouraged. 无论如何,这将是可怕的用户体验,因此不鼓励这样做。

This behavior will with 99% certainty get your app rejected on the App Store. 此行为将以99%的确定性使您的应用在App Store上被拒绝。

The normal behavior a user (and Apple) expects is to have the app quit only when the home button is pressed. 用户(和Apple)期望的正常行为是在按下主屏幕按钮时退出应用程序。 Any other means of quitting an app, including special buttons, excessive crashes, etc. will flag it for rejection. 退出应用程序的任何其他方式,包括特殊按钮,过多的崩溃等,都将其标记为拒绝。

You can do this only for iOS 3.2 In applicationWillTerminate do 您只能在iOS 3.2中执行此操作,在applicationWillTerminate中

NSString *UrlString = [NSString stringWithString: @"yourAppSchema:"];
    [application openURL:[NSURL URLWithString:[UrlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]]]; 

First you need to update your Info.plist of your app to support an url schema 首先,您需要更新应用程序的Info.plist以支持url模式

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>yourAppSchema</string>
            </array>
            <key>CFBundleURLName</key>
            <string>com.yourCompany.yourAppSchema</string>
        </dict>
    </array>

The way you do this is to put your iPad in something like This And also read this thread . 您执行此操作的方法是将iPad放在类似This的位置,并阅读此主题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM