[英]Store Android in-app purchases in SharedPreferences
Is it okay to store user in-app purchases in SharedPreferences? 将用户应用内购买存储在SharedPreferences中可以吗? Moreover will SharedPreferences (which are saved to user's Google account, if I'm not wrong) will be the same for the app among all user's devices, which use same Google account?
此外,在使用相同Google帐户的所有用户设备中,该应用程序的SharedPreferences(如果我没有记错的话,保存到用户的Google帐户)会相同吗?
Julian is right, you should always query for the purchases, in onResume()
for example. 朱利安是对的,您应该始终查询购买商品,例如在
onResume()
中。
If you did want to store the product id or part of the receipt in SharedPrefs just make sure to use Context.MODE_PRIVATE
and I wouldn't store anything like purchaseToken
or orderId
. 如果你确实想保存收据SharedPrefs的产品ID或部分只是确保使用
Context.MODE_PRIVATE
,我也不会储存像什么purchaseToken
或orderId
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.