How to detect the active iTunes store on the iPhone/iPod Touch/iPad?

前端 未结 7 761
你的背包
你的背包 2020-12-07 23:29

I\'d like to be able to determine which store the user connects to from inside my app, so that I can direct them to some appropriate content for their device AND store. Doe

7条回答
  •  没有蜡笔的小新
    2020-12-07 23:55

    Since iOS 13.0, Apple introduced the SKStorefront API.

    It allows you to check the current AppStore country the user is connected to.

    SKStorefront: An object containing the location and unique identifier of an Apple App Store storefront.

    Overview

    In-app products you create through App Store Connect are available for sale in every region with an App Store. You can use the storefront information to determine the customer's region, and offer in-app products suitable for that region. You must maintain your own list of product identifiers and the storefronts in which you want to make them available.

    Topics

    • countryCode: The three-letter code representing the country associated with the App Store storefront.
    • identifier: A value defined by Apple that uniquely identifies an App Store storefront.

    https://developer.apple.com/documentation/storekit/skstorefront

提交回复
热议问题