cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.

Home Page:https://www.cocos.com/en/cocos2d-x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SDKBOX IAP: How to read "receiptCipheredPayload"

asnagni opened this issue · comments

  • cocos2d-x version: 3.17.2
  • devices test on: iPhone X, 11, 12, 5, etc..
  • developing environments
    • NDK version:
    • Xcode version: 13
    • VS version:
    • browser type and version:

Steps to Reproduce:
When I make the call "sdkbox::IAP::restore()" the handler "onRestored(sdkbox::Product const& p)" is called.
The "p.receiptCipheredPayload" is not empty, I would like to know how can I read the data of "receiptCipheredPayload". I tried to use "cocos2d::base64Decode()" but I'm garbage. Would someone know how to decode the "p.receiptCipheredPayload" returned.

  1. Make sure to purchase an non-consumable item
  2. Call the sdkbox::IAP::restore()
  3. In the handler onRestored(sdkbox::Product const& p) check "p.receiptCipheredPayload"
  4. Try to decode it with "cocos2d::base64Decode()"

Thank you,
Stay safe

for iOS we need to communicate with the server.