Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I force an iPhone user to upgrade an application?

Is it possible to force the user to upgrade once there is a new version of my application available in the iTunes Store?

I am presently working on an application. However, I want to force the upgrade whenever I upload a newer version, because the upgrade will have more features and I want to discard the previous version. Is this possible by default with iPhone or do I have to write my own implementation to check the current version and compare it to the store?

like image 884
Nareshkumar Avatar asked Feb 08 '10 12:02

Nareshkumar


People also ask

Can you force update an app on iPhone?

Open the App Store. Tap your profile icon at the top of the screen. Scroll to see pending updates and release notes. Tap Update next to an app to update only that app, or tap Update All.

Can I force users to update the app?

You can use https://appupgrade.dev/ service to force update you mobile apps. You need to create new version for your app versions you want to update in the app upgrade service and select whether you want to force it or just want to let users know that new version is available. See the response has force update true.

How do I force an iOS app to download?

1. To download a favored app first just double-tap it. Yep, that's it. The double-tap forces iOS to download your favored app next.


1 Answers

I have done this feature by getting version from itunes webservice and comparing with the current version.. Following is my code

        NSString *version = @"";         NSURL *url = [NSURL URLWithString:@"http://itunes.apple.com/lookup?id=<Your app ID>"];         versionRequest = [ASIFormDataRequest requestWithURL:url];         [versionRequest setRequestMethod:@"GET"];         [versionRequest setDelegate:self];         [versionRequest setTimeOutSeconds:150];         [versionRequest addRequestHeader:@"Content-Type" value:@"application/json"];          [versionRequest startSynchronous];          //Response string of our REST call         NSString* jsonResponseString = [versionRequest responseString];          NSDictionary *loginAuthenticationResponse = [jsonResponseString objectFromJSONString];          NSArray *configData = [loginAuthenticationResponse valueForKey:@"results"];          for (id config in configData)          {             version = [config valueForKey:@"version"];         }    //Check your version with the version in app store         if (![version isEqualToString:[itsUserDefaults objectForKey:@"version"]])          {             ProAlertView *createUserResponseAlert = [[ProAlertView alloc] initWithTitle:@"New Version!!" message: @"A new version of app is available to download" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles: @"Download", nil];         [createUserResponseAlert show];          [createUserResponseAlert release];         } 

And put the app id in the itunes link see the code below..

- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {     // the user clicked one of the OK/Cancel buttons     if (buttonIndex == 1)     {         NSString *iTunesLink = @"itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=<appid>&mt=8";         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];     } } 

Note : You need JSONKit frame work and ASIHttp frame work to make the webservice calls..

like image 151
Dilip Rajkumar Avatar answered Sep 23 '22 19:09

Dilip Rajkumar