简体   繁体   English

Android / iOS应用内结算。 唯一身份

[英]Android/Ios in-app billing. unique ID

i made a cordova 3.3 app for Android and Ios, and i want to sell a premium version that permit to save settings and data for every on my distant database for an easy recovery if they change their phones. 我制作了一个适用于Android和Ios的cordova 3.3应用程序,我想出售一个高级版本,该版本允许保存我的远程数据库中每个数据库的设置和数据,以便他们更换手机后可以轻松恢复。

Initially i thought to get their google/apple account email but it seems to not be possible. 最初我以为会收到他们的google / apple帐户电子邮件,但似乎不可能。

So i thought that i just need an unique ID from the item purchased that i should use as an userID on my distant database. 因此,我认为我只需要从购买的物品中获得唯一的ID,就可以将其用作我的远程数据库上的用户ID。

I use this plugin for android: https://github.com/poiuytrez/AndroidInAppBilling/tree/master/v3 我将这个插件用于android: https : //github.com/poiuytrez/AndroidInAppBilling/tree/master/v3

So, the inappbilling.buy(success, fail, productId) and inappbilling.getPurchases(success, fail) both return a json object like this ex: 因此,inappbilling.buy(success,fail,productId)和inappbilling.getPurchases(success,fail)都返回一个json对象,例如:

{"orderId":"12999763169054705758.1385463868367493", "packageName":"com.example.myPackage", "productId":"example_subscription", "purchaseTime":1397590291362, "purchaseState":0, "purchaseToken":"ndglbpnjmbfccnaocnppjjfa.AO-J1Ozv857LtAk32HbtVNaK5BVnDm9sMyHFJkl-R_hJ7dCSVTazsnPGgnwNOajDm-Q3DvKEXLRWQXvucyW2rrEvAGr3wiG3KnMayn5yprqYCkMNhFl4KgZWt-4-b4Gr29_Lq8kcfKCkI57t5rUmFzTdj5fAdvX5KQ"} {“ orderId”:“ 12999763169054705758.1385463868367493”,“ packageName”:“ com.example.myPackage”,“ productId”:“ example_subscription”,“ purchaseTime”:1397590291362,“ purchaseState”:0,“ purchaseToken”:“ ndglbpnjmbfccnaocnppjjfa.AO- J1Ozv857LtAk32HbtVNaK5BVnDm9sMyHFJkl-R_hJ7dCSVTazsnPGgnwNOajDm-Q3DvKEXLRWQXvucyW2rrEvAGr3wiG3KnMayn5yprqYCkMNhFl4KgZWt -4- b4Gr29_Lq8kcfKCkI57t5rUmFzTdj5fAdvX5KQ“}

Can someone confirm me than orderId is strictly unique on android? 有人可以确认我,而orderId在Android上绝对是唯一的吗? (with source link or proof pls) ? (带有源链接或证明请)?

I will have the same issue on Ios, so do you know a if a value will can make the deal on Ios? 我将在Ios上遇到同样的问题,所以您知道一个值是否可以在Ios上达成交易? I can't see the return value of the restore function in this plugin: https://github.com/j3k0/PhoneGap-InAppPurchase-iOS 我在此插件中看不到恢复功能的返回值: https : //github.com/j3k0/PhoneGap-InAppPurchase-iOS

If it's ok for both, i could regist an ID like this : "android_" + orderId Or "ios_" + ??? 如果两者都可以,我可以注册这样的ID:“ android _” + orderId或“ ios _” + ??? as user ID 作为用户ID

Ok i found the answer on the ref... sorry. 好吧,我在裁判上找到了答案。 http://developer.android.com/google/play/billing/billing_reference.html http://developer.android.com/google/play/billing/billing_reference.html

"orderId : A unique order identifier for the transaction. This corresponds to the Google Wallet Order ID." “ orderId:交易的唯一订单标识符。它对应于Google电子钱包订单ID。” So i think it's ok for android. 所以我认为对于Android来说还可以。 i will look on the Ios ref. 我将看看Ios参考。

If you think about better idea for my case, feel free to add another answer. 如果您想为我的案例提供更好的主意,请随时添加另一个答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM