Android In-App-Purchase, how to check if user have purchased one item

前端 未结 4 1064
醉梦人生
醉梦人生 2021-02-13 01:20

is that OK and safe to set a value in SharedPreference to flag that the user have purchased this item? What if user hack this value in SharedPreference. Or I need to connect IAP

4条回答
  •  感情败类
    2021-02-13 02:11

    As what Kuffs has mentioned, it is best to query the app-side implementation of the In-App Billing library which in turn queries the device's Google Play client. This will ensure that the purchase history most recently obtained from the Google Play servers would be reliable and relatively fresh information.

    Also, keep in mind that if you are distributing the app on Google Play you MUST use the Google Play payment mechanism via In-App Billing. As it stands, Google Play and Wallet do NOT yet support Paypal or wire/bank transfer methods so you should not integrate the option if you are releasing it on Play.

    http://play.google.com/about/developer-content-policy.html#payments

提交回复
热议问题