我正在尝试实现“应用内订阅”,为此,我尝试了以下步骤
“管理产品”的应用内购买正常。但是当我尝试订阅(应用内订阅)时收到错误响应 IabResult:IAB返回了空的PurchaseData或dataSignature(响应:-1008:未知错误)
代码
try{
billingHelper.launchPurchaseFlow(activity, "sub_2", REQUEST_CODE_SUB,
new IabHelper.OnIabPurchaseFinishedListener() {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) {
if (result.isSuccess()) {
//TODO after subscription write code to handle success case
Log.e("TEST", "success purchasing: " + result);
} else if (result.isFailure()) {
//TODO handle failure case
Log.e("TEST", "Error purchasing: " + result);
return;
}
}
});
}catch (IabHelper.IabAsyncInProgressException e) {
e.printStackTrace();
Log.e("TEST", "IabHelper error "+e);
}