Testing In-App purchases for multilanguage

2019-03-25 09:06发布

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?

2条回答
相关推荐>>
2楼-- · 2019-03-25 09:40

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:

  1. 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)
  2. Created two new test user accounts: frenchtestuser@mydomain.com & chinatestuser@mydomain.com, set to the France and China store respectively.
  3. On the device go to Settings=>Store=>Signout
  4. Run the app and initiate a purchase
  5. At itunes account dialog prompt login with frenchtestuser account
  6. AFter purchase complete perform a new SKProductsRequest
  7. Confirm dialog prompts and product details display the French localization
  8. Close app and start again from step 3 this time logging in with chinatestuser account.
查看更多
霸刀☆藐视天下
3楼-- · 2019-03-25 09:42

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.

查看更多
登录 后发表回答