Kevin_TA
Kevin_TA

Reputation: 4685

iOS - Prompt User to Update to Latest App Version

Is there any method or plugin available that will alert the user to upgrade an app if the version they are using is not the latest? I suppose I could ping a web service to check what the current version is and compare with the user's version and go from there. As an aside, is there a way to check the current version of the app (some property I don't know about) or do you simply have to hardcode the version as some float variable or something?

Thanks

Upvotes: 5

Views: 6687

Answers (5)

Rajasekaran Gopal
Rajasekaran Gopal

Reputation: 399

There is update version of harpy called siren that will help you. Below is the link, https://github.com/ArtSabintsev/Siren

Upvotes: 2

Gavin Miller
Gavin Miller

Reputation: 43865

There's a nice little open source library available called Harpy that will accomplish this for you! It provides the ability to check for updates on startup, daily, or weekly, and it uses itunes to do the checking, so config is really minimal.

Upvotes: 3

digidigo
digidigo

Reputation: 2584

You can grab the version from the info.plist with

    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
self.applicationVersion = [infoDict objectForKey:@"CFBundleVersion"];
self.applicationBuild = [infoDict objectForKey:@"CFBundleShortVersionString"];

And, yes just hit a web service. Or even easier you could just put a file up on S3 and update that with your version number.

Upvotes: 0

The Lazy Coder
The Lazy Coder

Reputation: 11838

you will need to build the update check functionality yourself. however you can get the version info from the app.

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];

Bear in mind tho that just because you have an app up. and it has been released into the store. that does not mean the app is immediately available to all users via the app store.

Upvotes: 1

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

You'll have to build such a solution yourself. There's no update-checking functionality provided by the iOS SDK.

Most apps just check a website or similar, as you've already considered.

Upvotes: 0

Related Questions