is there a way to automatically update iPhone apps? - iphone

I am looking for some way to automatically launch the app store on an iPhone from within an app. For example, the user logs in using the app, and the server requires a specific version of the app. Can I open the app store, or grab the upgrade automatically, or does the user need to go through the app store manually?
Thanks in advance,
Conrad

The user needs to go through the AppStore to get the upgrade. The user might choose not to upgrade the app for whatever reason and you can't force update.
Of course, you can navigate to the AppStore page and offer the choice to the user.

Have you tried [[UIApplication sharedApplication] openURL:#"itms://..."] with the URL for your app?

Related

To update ios app when newer version is available

I am totally new to ios development.
I have an ios7 and ios8 app which do polling to Server to check for latest version.
Once the latest version of app is available I am opening Alert Box(Notification) for user to update App.
Now, once user click on Update Button, Which API I need to use to get latest version of App from Apple App Store or Web Store.
And how can I move the user's saved preferences to new App.
Will be helpful If some one can put code sample to do so.
I don't believe there's an API which you can call to update the app. The only option available is to send the user to the App Store page for your app where they will see the update button.
As far as preferences go if you're storing them in NSUserDefaults or as a plist then they should persist unless the user deletes the application from the device.
I found the solution to my problem.
Every App has a unique url in the App Store.
Lets assume you have updated your app from version 1.1 to 1.2 and releases app in app store.
Now in the application after checking your app version you can use openURL method to redirect to the url of App in app Store
e.g.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"AppURL-String"]];

How to get itune link of our own application?

I am new to iphone development .I am in to project where application iTunes should be able to share on Facebook,twitter.I want to know how to obtain the iTunes link of the application.
Thanks in advance
No you can't. You should give the link manually to the app or you should program the app to get the link from your own web server using web service. Here also you should update the link in you web server
The iTunes link needs your app id from iTunes connect. There is no way for your application to actually know that number. However the app does not need to be released already to get the link, only to be created in iTunes Connect. That way you can still implement sharing functionality within your app using the link, and only then upload your binary.
As everyone suggested, you need to create your app within iTunes Connect to get the App ID.
Once you have this, you can hardcode it into your app. An alternate way is to query your own server and have this information ready at the time the app is launched.
I would really suggest going for the hardcode method since the App ID doesn't ever change once it is assigned to your app.
Here's an example of how I usually embed the URL for my apps with its App ID: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=APP_ID&mt=8&partnerId=30

how to implement automatic update feature in iphone?

I am developing an iPhone app. It has an option called automatic update. it can be updated automatically once in a week/month/6 months. Could you please let me know How can I invoke my desired method based on this setting even my app was not opened by the user?
You can't, the user will need to open the app, there is no way to schedule update routines.
You could inform the user that he/she need to update with an UILocalNotification, but I would suggest only to update your app when the users starts it.
It's against apples rules to push an updated app within your app. You have to resubmit to the app store.
what you can do is that increase badge count of application icon on receiving notification from UIlocalNotification.
when user open application check the application badge count if it is more than zero apply your logic to update application.
else there will be no update popup to client.

Is It Possible To Add A "Rate This App" Link To My App?

Here's what I'm trying to do: I have a button on the settings page in my app - I want this to direct users to the review/rate page on the app store.
I know this is possible using [[UIApplication sharedApplication] openURL: .... ]; but my app is unreleased as of yet, so I don't have a URL to use.
Is it possible to implement this functionality for an unreleased app, or would I have to wait and include it as an update?
Thanks :)
The URL below is what you're looking for.
Just replace the 368754825 after id= with your app's Apple ID from iTunes Connect. This will take you right to the review page and won't have all the redirects like a normal link. Your App's Apple ID will not change between now and when it's on the store.
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=368754825&pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8
Update:
I tested the link I posted more than a year ago. It still works. The idea is that it won't work until your app is live. I know there's some concern about putting this link in and shipping before actually verifying it works, but it's the best option for having a review link in a 1.0. You can alternatively submit a 1.0.1 update (with link) right after 1.0 (without link) is approved which means you're only missing out on about a week's worth of reviews.
This is newest format for creating review form links on iOS (only works for iOS devices) [tested on 4.2]
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=412843648
Replace the final string of 9 numbers with your app's application ID from iTunes connect or your iTunes url. This link when launched from an iOS device takes you directly to the reviews
Yes you can add a link.
What I did for one of my apps that wasnt released yet was point to a certain URL, like: http://www.wrightscs.com/ios/myapp/review.html which just contained an http redirect.
Once my app was released and I had the iTunes Store link, I just updated the review.html page with my apps URL.
So now my app opens the review.html link, but in return gets redirected to my app in the app store.
First of all you have all the data about your app when creating it on iTunes connect. The thing you need here is the "Apple ID" (you can find it on iTunes connect under the app information).
After taken this number you can use it inside your app (even hard-coded) asking users to rate it or any other thing you want to do with it.
You can use this code for doing so, This method would open the rate page for your app on the App Store without opening safari on the way like other methods here (I've put all code which seems easier to understand sometimes):
static NSString *const iOSAppStoreURLFormat=#"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%u";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:iOSAppStoreURLFormat, (unsigned int)YOUR_applicationID]]];
Where YOUR_applicationID is the one you took from the app store (Apple ID).
I suggest you test that with a working app (active on the app store, even not your, You can use this one for example: 474785950) and change it afterwards. Pay attention to download the app you are rating to your device/account (You can always know the Apple ID of working apps from the link itself : http://itunes.apple.com/us/app/i-ruler/id474785950?ls=1&mt=8 it's the number just after the "id").
Moreover, For this topic I have some other things that should be considered:
1. Apple can reject your app if you are asking users to rate your app with 5 stars, Many developers does that and don't get rejected but I've been rejected couple of times just for that. Beware!
2. Asking users for just a rating mostly doesn't have a good effect, Great feedback comes only after the user used the app and really enjoyed that (users are really used to popups asking them to rate and just skip it). Also if user want to skip this process for now you want to try asking him later, And most importantly you want to ask the user to rate your app after an update (that is super important because rating is for each version!). To solve this case I suggest using iRate (or build something custom using that as starting point) which is very easy to integrate and it can ask for rating only after several days/opening times etc. and remembers to do that for each version. Can download it from: https://github.com/nicklockwood/iRate/tree/master/iRate
I think that the direct link to 'write the review' is undocumented. It is better to give link to the app and it will be up to user to write the review.
You can get the link to your app from your account in iTunes Connect.
You will get the link once you add a new application (not necessarily upload and make it live). That link will open your app regardless of the platform (iPhone, Mac, PC).
That link will not work un till the app is live.
This method worked for me!
Swift 2 version this code works for iOS 9:
let appId = "12345678"
let url = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=\(appId)"
UIApplication.sharedApplication().openURL(NSURL(string: url)!)

iphone application update

i would like to check:
if a user downloaded my app, than i make some update to app, data etc., itunes will auto remind the user of the update through app store, and the user can update for free? or do i have to set such reminder in my application?
else, is there a way for me to send this notification?
thks
Rgds
Yes, the phone notifies of app updates through the App Store app and app updates are free.
Alternatively, you can use push notifications to notify the user that a new version is available, or display an alert the next time they open the app.
To do the latter you can query the version of the app ([[NSBundle mainBundle] objectForInfoDictionaryKey:#"CFBundleVersion"];) and compare it to a value provided by your web server.