我正在将InApp购买集成到我的游戏中(使用Cocos Creator构建)。但无法在Android和Facebook.com上的FBInstant.getSupportedAPIs()中获得payment.purchaseAsync。请在下面提供我的示例代码。
let supportedAPIs = FBInstant.getSupportedAPIs();
if(supportedAPIs.includes('payments.purchaseAsync'))
{
console.log('payments supported...');
FBInstant.payments.onReady(() => {
console.log('payments ready...');
FBInstant.payments.purchaseAsync({
productID: 'com.test.testing',
developerPayload: '',
}).then(function (purchase) {
console.log(purchase);
});
});
}
else
{
console.log('payments not supported...');
}