Testing localized in-app purchases - ios

Running the app with the Scheme set to another language does not affect the SKProduct received from iTunes in testing. The only way I’ve found to affect change is to create a new Sandbox Tester User in iTunes Connect with an iTunes Store for each... and every... language you might want to test.
Then - you should NOT login with that user on your device through Settings. Run your app and login with the test user when asked.
This successfully got my phone to be defaulting to the App Store for a different country.
But still, when I printed to the console each SKProduct’s .localizedTitle, .localizedDescription, and .price - only the price was translated to the different country’s numbers. The title and description remained in English (I’m developing in the United States). All the languages are set up in iTunes Connect.
When I click to purchase an in-app, the system pop up is in English: "Confirm Your In-App Purchase" and then "Do you want to buy one ____ for ___?" and "Cancel" and "Buy" buttons all in English. The first blank is filled in by Display Name that I set in iTunes Connect. But it is still using the English version. And the second blank is filled in with the price, which IS SHOWING in the language of the Test User's store. [separate issue: Japanese shows the Yen symbol and price. Spain shows the Euro symbol and price. Mexico shows the Dollar sign with the Peso price.]
So only the price translates for my Sandbox Tester account. Anybody know how to get the title in a different country’s language during testing? Not only do I want to make sure that it will look right to people in each country I've localized the app for, I’d like to set the SKProducts' titles as labels on buttons in my app to launch the in-app purchases. I could set these through the Localizable.strings file but would prefer to pull it from the SKProduct since I've already entered that information through iTunes Connect.
Thanks for any help!

Here is what I've been able to figure out, to the best of my ability. This is pretty tricky to test... sometimes needed to run the app 3 or 4 times and load the list of SKProducts over and over again before a localizedDescription would change to the language I was trying to test.
I was trying to figure out if these are controlled by logging in with a Sandbox Test User that was created with an iTunes Store set to another country? Or by the iPhone's language chosen in Settings?
SKProduct's .price, SKProduct's .localizedTitle, SKProduct's .localizedDescription, and the system pop up "Do you want to buy one ____ for ___?" / "Cancel" / "Buy"
It seems to me that to properly get all the values for each language, you need BOTH to have changed the phone's system language AND to log in with a Sandbox Test User created for the country's App Store.
To populate my button text, I did the following:
let formatter = NSNumberFormatter()
formatter.numberStyle = .CurrencyStyle
formatter.locale = productName.priceLocale
let cost = formatter.stringFromNumber(productName.price)!
labelForButton = "\(cost) " + productName.localizedDescription

You are right: change Scheme's language will not affect the SKProduct.
Go to change "App Store's Country/Region", then you can see the changes, how to change:
https://apple.stackexchange.com/a/89186/283550
Also refer to my answer in another post:
https://stackoverflow.com/a/52418249/3260008

Related

AppstoreConnect: Company individual developer name instead of App description

I was searching for a while and not found nothing...
I have an app published in iTunesConnect, but instead of the app description (previously setted in AppstoreConnect),
like in the image below:
Subtitle demonstration
... The owner account name (individual account developer name) is being presented.
Like this:
App Store demonstration
How i can change this to the appstoreconnect description text?
You are mixing things up. By default the App Store displays two values:
a) App title/name at the top
b) App subtitle at the bottom
If there is no active app subtitle, the App Store falls back to the developer name. (Sometimes if the App Store is "slow", you will see the developer name for a couple of seconds, before it is replaced by the subtitle)
You can check the behaviour in this short video/gif I just made: https://imgur.com/a/ZR3f42v
The developer name is something you cannot change yourself in App Store Connect. It is the initial name you signed up with over at https://developer.apple.com/enroll
If you signed up as an individual developer, it will show your personal name.
If you signed up as a company, it will show the full company name.
You can change this, but need to contact Apple Developer Support for that: https://developer.apple.com/support/app-store-connect/ They can also help you with upgrading your account from personal to company.
For ios 11 to onward enter subtitle it will display below app name.
Go to iTunes -> select app -> select app store -> app information -> enter subtitle

In-App-Purchase sandbox testing - Purchasing Not Supported in your region

I developing an App for Ukrainian people with In-App-Purchase. When I add sandbox tester with Ukraine location and try purchase I am getting this alert .
If I use some other location, Russia for example - thats good. My App is for Ukrainian people and I am disturbed by this.
Does anybody know how to resolve this issue?
Apple is a US company and are therefore they are prohibited from carrying out business transactions with the Crimea region of the Ukraine as per executive order 13685 section 1 (a) (iii)
(iii) the exportation, reexportation, sale, or supply, directly or indirectly, from the United States, or by a United States person, wherever located, of any goods, services, or technology to the Crimea region of Ukraine;
I suspect that since you don't enter an address, just a store, when creating a sandbox user, they don't know which region you are in and they default to blocking the purchase. In production, a user has a registered address which lets Apple block purchases more selectively.
It looks like you will need to complete your testing with a user from another store.
Note: iOS 12+ Only
Sign in into your main account. Then you will see option for SANDBOX ACCOUNT.
Use not Ukrainian test account and test your purchases.
Sandbox Account Image:
You need to create the sandbox tester, related to not Ukrainian Itunes Store. Something like this:
Many thanks to Mike form Cherrypie Studio
I had the same error that was caused by using test user with Ukrainian country. But that error didn't go away even after I logged out from that account, created new non Ukrainian one, logged in(many times), logged out (many times), deleted an app, restarted the phone...
The only thing that helped was device reset. Only after that system stopped showing me that error and I finally saw App Store login window again.

In-App Purchase Depending on Location

Does the in-app popup changes currency depending on the location?
For example:
If i'm in the US the currency = $.
If i'm in Japan the currency = ¥.
If i'm in Germany the currency = €.
If yes, is this automatic (like apple handles it for you, you just have to register $ currency)?
If it's automatic, how can i test if it's working? I tried changing my location in the settings and the currency is still in $.
If it's not automatic, how do i enable it?
Not location, but depending on which country's App Store you are logged in, yes.
The pricing table for the different currencies is available in Apple's documentation (note that you choose pricing levels, not dollar amounts).

Multi-device support for non-renewing subscription

I'm working on a news app. All news items are fetched from my website. To make a bit of a profit out of it and keep the website running, I implemented some ads. Now, I'd like the user to be able to turn off all ads in the app for a few bucks. I want to provide this option on a yearly basis. So, this year there will be a button in my app, reading something like "No ads in 2013". After paying, the app will be ad free for the rest of the year. In 2014, ads start popping up again and the user can buy the product "No ads in 2014", for the same amount.
I figured a non-renewing subscription would be the way to go here. A few things I haven't figured out yet:
Is it possible to automatically change the name of the in app purchase over time such that it reads "No ads in 2013" in this year and "No ads in 2014" next year, "No ads in 2015" after that, and so on?
Apple states that it is the responsibility of the developer to implement multi-device support. Ok, fair enough, but I haven't found a way to identify a user yet. Users don't need to be logged in to use my app and as far as I know, there is no way to get hold of the user's iTunes login name. How can I transfer the product to a user's new iPhone for example?
After much thought my conclusion is that there is no way to achieve this without bothering the user to log in in some sort of way.
The alternative I came up with is this:
I just create a regular non-consumable in app purchase, with the year embedded in its identifier. This way, in code I can check the identifier against the current year and determine if the user should buy the product with identifier "year + 1".
As non consumable purchases are linked to the user's iTunes account, they are automatically transferred to other devices like a new phone.
Only thing I must not forget is to create a new product for every year to come.

Testing In-App purchases for multilanguage

I have included various localized descriptions in iTunesConnect (English, French, Chinese) for an in-app product. I am displaying the localizedTitle and localizedDescription properties after fetching them from apple's server using an SKProductsRequest.
My understanding from the docs and other threads is that if I change the test phone to the relevant language it will display the correct language. However in testing with my phone in French or Chinese the product descriptions are still in the original English.
I am not logged on with any iTunes account during the testing (Settings=>Store=>Signout).
Can anyone provide any hints how to test the IAP multilingual functionality?
I believe the localization that the store returns for the product description is based on the assigned iTunes store of the test user you are using. The device's language setting only pertains to the resources loaded locally.
After further testing I have confirmed that #claireware was in fact correct in his answer.
The tester is not able to manually change or set the store for testing (Apple docs state not to login with test user (Settings=>Store=>Signin)). However if you make a test purchase and enter the test users credentials at the prompt the device will warn you that it is changing to the test user country's iTunes store. After you make a test purchase the test user will be logged in and your subsequesnt SKProductRequest will return information localized for that store.
In summary for localization testing I followed these steps:
In iTunesConnect create one or more SKProducts with localized
text in English, French and Chinese. (no I dont know French, so I
just used random French words for testing)
Created two new test user accounts: frenchtestuser#mydomain.com &
chinatestuser#mydomain.com, set to the France and China store
respectively.
On the device go to Settings=>Store=>Signout
Run the app and initiate a purchase
At itunes account dialog prompt login with frenchtestuser account
AFter purchase complete perform a new SKProductsRequest
Confirm dialog prompts and product details display the French
localization
Close app and start again from step 3 this time logging in with
chinatestuser account.

Resources