1

这是我的想法: google iab 插件应用内计费的服务器端验证工作流程是否正确?

1.在unity3d中关闭自动验证

2.java方法handleActivityResult调用onIabPurchaseCompleteAwaitingVerification

3.onIabPurchaseCompleteAwaitingVerification 调用unity3d中的方法 GoogleIABManager.purchaseCompleteAwaitingVerification(string json)

4.统一将消息发布到我自己的游戏服务器进行验证。

5.服务器验证后,将结果发送给unity。

6.这里我在GoogleIABManager中添加我自己的方法

public static void ManualVerifyResult(int result, string json){ if(purchaseSucceededEvent!=null && result ==1}{purchaseSucceededEvent.fire(new GooglePurchase(json.directoryFromJson())); else if (purchaseFailedEvent!= null && result== 0){ purchaseFailedEvent(dict["result"].toString(), responseString)}} 

7.然后引发的purchaseSuccessEvent向我的游戏服务器发送消息并将项目添加到数据库,引发的purchaseFailedEvent在UI上显示错误消息?

4

0 回答 0