0

我正在嘗試使用react-native-billing添加In App Purchase for Play商店,但不知道該怎麼做。在Android版應用帳單中實施React Native?

谷歌似乎無法找到在應用內結算的任何教程

我所見過的example它看起來像這樣

InAppBilling.open() 
     .then(() => InAppBilling.purchase('android.test.purchased')) 
     .then((details) => { 
      this.setState({ 
       purchaseText: details.productId 
      }); 
      return InAppBilling.getProductDetails('android.test.purchased'); 
     }) 
     .then((productDetails) => { 
      this.setState({ 
       productDetailsText: productDetails.title 
      }); 
      return InAppBilling.close(); 
     }) 
     .catch((error) => { 
      this.setState({ 
       error: error 
      }); 
     }); 

這是很簡單的。但我不明白的是android.test.purchased

也許這就是BCZ我的知識缺乏有關的In App Purchase在Android

我還沒有得到什麼details & productDetails &在哪裏實施這些

如何實現它?

回答

0

我沒有看到In App Products下拉框中寫的是什麼。它被寫入To add in-app products, you need to add the BILLING permission to your APK.現在我可以執行。

相關問題