Refreshing iOS app receipt: How to determine if user will need to sign in for app store?

前端 未结 3 738
猫巷女王i
猫巷女王i 2021-02-03 23:45

I am implemeting Apple\'s \"Grand unified receipt\" on iOS 7, which allows the app to check an app\'s purchase receipt locally without having to contact Apple\'s servers for val

3条回答
  •  耶瑟儿~
    2021-02-04 00:22

    In an App Store app the receipt usually exists. It's downloaded from the App Store along with the app. If the user loads your app onto their device with iTunes (i.e. from a backup) there won't be a receipt.

    The main use case for the receipt not being there is when you are debugging in Xcode and haven't done anything to cause the receipt to be downloaded (like refreshing the receipt or buying something).

    In production, you can only get a new (fresh) receipt after some user action (they buy something, you refresh the receipt and they sign in, they restore purchases and sign in). There's no way to silently refresh the receipt.

    If you want to get a new receipt without user action, you have to go the server route. Send the old receipt via your server to iTunes, get the latest receipt back.

提交回复
热议问题