Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by freelancegordon · Mar 13, 2017 at 05:20 PM ·

Is there any way to restore purchases without using RefreshReceipt on IOS?

HI guys,

I'm trying to implement restore purchases on ios for Unity, and unfortunately Unity's IAP SDK doesn't seem to provide a way to get the RefreshReceipt that PlayFab requires in order to restore purchases for IOS.

So I'm wondering the best way to proceed, as I can validate the receipt locally with UnityIAP, and then manually grant the item but that's obviously not as secure.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Mar 14, 2017 at 01:37 AM

Our sincere apologies for the confusion on this issue. The issue here was one of confusion between "refresh" and "restore" receipts, and we're fixing all documentation to clarify this. In point of fact, the correct process is to submit the receipt obtained via a call to the restoreCompletedTransactions method of SKPaymentQueue in the Store Kit (https://developer.apple.com/reference/storekit/skpaymentqueue/1506123-restorecompletedtransactions). That receipt will contain updated receipts for all non-consumable purchases made by the player, and so will restore purchases made in another PlayFab account.

One thing to bear in mind though, is that this does provide a hacked client with a way to get multiple instances of non-consumable goods, by hitting the restoreCompletedTransactions call multiple times, and using all those receipts. While this would, ultimately, only cause problems for the player (since it would cause the inventory to fill up with these items if they did this a lot), a safer route would be to only sell virtual currencies (a consumable good) in the iTunes store, and then use that VC to make purchases of digital goods via your game's Catalog (using PurchaseItem). And, of course, the best route is always to make sure you can reliably get the player back to their original account on any device by incorporating alternate authentication systems, like Facebook, Twitch, and Google whenever possible.

Comment

People who like this

0 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image freelancegordon · Mar 14, 2017 at 10:33 AM 0
Share

Thanks for the clarification Brendan, it's much appreciated.

That may have to be the route I take for this application, thankfully inventory shouldn't be too much of an issue as the only non-consumable item we sell is 'remove advertisements' the rest is consumable virtual currency. Unfortunately my client is insisting on totally anonymous users, so we won't be able to log them in with fb/twitch/twitter/etc (additionally, we're having a lot of issues balancing the 65k DEX limit on android)

Lastly, do you have any advice as to how I might access the restoreCompletedTransactions method of StoreKit via Unity? I've asked on their support forums but haven't had a response as of yet and this is one of the last things I need to do that's critical for Apple App Store submission for this app.

Thanks again!

avatar image Brendan ♦♦ freelancegordon · Mar 14, 2017 at 07:24 PM 0
Share

I don't believe Unity offers direct access to that API call. Most developers I know are using a plugin such as Prime31 for this, or writing native code to access that part of the Store Kit.

avatar image Brendan ♦♦ freelancegordon · Apr 21, 2017 at 08:15 PM 0
Share

Update: The Unity folks confirmed that you can get the restore receipt via UnityIAPRestoringTransactions.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges