Restrict features of iPhone app work for different app stores - ios

I have an app that is on appStore.However this app gets some of the data from server side from an xml
My app is on different apple stores. However I want to restrict some features to only specific app stores. How can I make the application to work for different app stores , lets say make the app read different xml for different app stores or something like that? Is that possible? Or maybe Any place inside app where my app can read the store Type e.g find out if its USA Store or Japanese store or Etc.

An easy way of doing this would be to have a input parameter in your API call which the application can request which country it's from, and then deliver your refined results based on that. Then, launch multiple apps in iTunes connect where each one specifies which country it is in the API request, and only allow it to be downloaded from that country.
For example, if you had two applications:
MY APP (UK) - API call: http://example.org/api/uk/request.xml
MY APP (USA) - API call: http://example.org/api/usa/request.xml
Note: The country you set in iTunes connect is the app store registered to the users account and not based on what country they are actually in!
Alternatively, you could use a online service to determine the location based on their IP. I haven't done this but a quick search finds:
http://www.makebetterthings.com/iphone/how-to-find-ip-address-of-iphone/
http://www.geobytes.com/iplocator.htm?getlocation

i think in you developer account in the app setting you can choose to which stores to upload, or do you mean like having different content for some stores?

Actually you can do it in two ways:
1- build a different binary for each country
or
2 - find an API that let's you know what is the reference store for an user
About this second option, a quick search in the Apple documentation didn't return me a specific API to do this.
Sure, basing on the Locale is not good (what if the user changes the language settings?)
The only way I found is to use SKProduct class. It has a priceLocale property that returns an NSLocale instance. So if you do:
mySKProduct.priceLocale.localeIdentifier
you'll have a NSString with the locale associated to the reference AppStore. (in my tests: it_IT#currency=EUR ).
I tried it in a project with in app purchase enabled, I think that you must setup a real SKProduct to make it work properly
Regards
Fabio

Related

How can I get identification string look like IMEI in IOS

My project have a case: one account user can only log on to one device ( if user log on to app in device A, user can't log on to app in device B). My Idea is: when user login, I'll get the imei Iphone (like android) and send it with request login to server. But I can't get imei. I try with UUID, but UUID will change when re install app. Keychain does not solve the problem. Please help me.
You have to use Keychain to store Unique Id , this will not change even if user delete app
You can use any wrapper Source code to do this
here is an example
https://github.com/Joe0708/KeychainUUID
At the beginning I'd like to mention that I do not know any method that directly answers your question, especially that Apple does not allow you to read IMEI and other similar stuff due to privacy concerns. This has been answered here.
The workaround might be as follows
Take a look at the UIDevice class, especially at the identifierForVendorProperty which provides you (according to documentation ) with a device specific value.
The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.
As far as i know some financial apps are secured this way to permit only one device to access the account. This however requires registering a device each time application is reinstalled.
Alternatively you can use UUID you generate within your app (first run) and then you assign it for the user online. It might take the form similar to two step verification process. Be aware however that with such restrictions user will have to be online all the time to use your app.

Show other applications list in one app

I going to show my other apps in one app. I know only one way to do that - just hardcoded icons, links and names of other applications, but it extremely inconvenient. Is there are way to reach itunesconnect's list of apps via some API?
You can use the iTunes lookup API to accomplish this. All you need is the developer ID of the account you want to lookup.
Here is a sample query for all of Facebook's apps:
https://itunes.apple.com/lookup?id=284882218&entity=software
The response contains a JSON object for the developer and then for each app, which includes any info you may want to grab such as the name or icon.

Different builds or configuration for each app store

I am building an online shopping app that I want to launch in the UK and US store territories. I was wondering is there any way I can provide different builds or different configuration for each store? The idea is that the app needs to send a string value key (that should be different depending from which store the app was downloaded) in the web requests to the server so the server knows what data to return to the app user (for UK and US users the result data is different).
Other solution I was thinking was to give user an option to select which store he wants to use. Any other ides, recommendation? Please suggest.
Question: can a user located in the UK shop the US store?
"Yes" scenario:
You may need two different apps or a selection inside the app;
Depending on this you select which resource to use as strings file for the web requests.
"No" scenario:
Take the location from the IP or user account;
With the info you select which resource to use as strings file for the web requests.
For the strings file using check the tutorial #borncrazy suggested (http://www.raywenderlich.com/2876/localization-tutorial-for-ios).

Store temporary data outside of iOS app

I have an app that is uniquely branded for each customer (think restaurants, etc.) I need to have the user be able to click on a link to my server that contains a unique code, stores that temporarily on the iOS device (cookie, etc.) and then directs them to the app store to download the app. Then when it is downloaded, the app grabs that cookie or temp. data on launch and brands the app for that customer. I know this is possible on Android, but is it on iOS?
Downloading the app first and then selecting the brand (or restaurant) is not feasible in this case, as the url wil be shared with other customers of the same business and we want to create a fluid experience, where they won't be able to "see behind the scenes" and choose a different branding.
Thanks
Edit
Thank you for all the replies. We've reevaluated and are considering having the url be opened on the device and grabbing the IP address or another unique id, and saving that along with the correct brand to a database. The app will then connect to the database on launch, and if the IP's match, will brand accordingly. We're looking for a more reliable identifier than IP, however. Now that UDID is deprecated, are there any other identifiers we can use?
I think the design you propose of a webserver link creating the code that needs to be read by the iOS app later is the issue. You should have a solution that is entirely app based. Perhaps you can have the same services on the website be available as one app which then sets up the code in pasteboard. The user then launches the actual app that looks at the pasteboard and skins itself accordingly.
That being said, data can be shared between apps from the same app seed ID by using UIPasteboard in addition to a few other ways.
I use the pasteboard to share info between apps quickly and easily using this class.
You can use identifierForVendor (UDID replacement) to identify individual devices. Are you planning on harvesting those identifiers prior to the end user "registering" the device at the final location? If not you'll never be able to determine which device belongs where.
What about having the end-user logging into your server as that restaurant? It can be a somewhat generic login per restaurant like "Wendys/Wendys5?" and "McDonalds/McDonalds7!" to determine their App Store URL. As long as the password is easy and non-programmatic to guess it would be unlikely they figure out how to register as a different restaurant. You could also do a simple restaurant selection screen coupled with a password specific to each chain but this would expose the user to which other restaurants are using the app. This way you won't have to continually add IPs if they expand locations and can revoke credentials if the login is compromised.
One question, though: Do all of your clients understand that they'll have to have an AppleID tied to each device? You can only shared a single AppleID across 20 devices.

Programmatically identify if an app is paid or free

I would like to identify whether an app is paid or free; programmatically, at runtime.
To brief on the context I'm working on, I'm developing an SDK which can be used by various third-party apps. I would like to identify if the app that is using my SDK is paid or free.
Any suggestions to find this?
You should make them configure your SDK writing their app id somewhere, and then your SDK have to check the app store webservices like this
https://itunes.apple.com/lookup?id=theAppID
There you can check the price
One thing you can do is this
https://itunes.apple.com/lookup?id=YOUR_APP_ID
and then fetch price & currency values from the returned JSON
There is a way tick into my mind,
Add a logic to get application name which using your SDKalso add some logic to send that name to you via API or any other way you preferred.
Once you get a new name in your server database, you can, open AppStore in iTunes, and search for the application there, and yes you'll get to know whether they are paid or free!
I know its tough if your SDKwill be going to fly with many apps, but not hard.
An alternate way, if there's some way that you get to know whether app is paid or free, then, you can do the same thing, send app name, and its price details.

Resources