简体   繁体   中英

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.

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.

The normal behavior a user (and Apple) expects is to have the app quit only when the home button is pressed. 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

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

<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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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