Search in sources :

Example 6 with BillingFlowParams

use of com.android.billingclient.api.BillingFlowParams in project react-native-iap by dooboolab.

the class RNIapModule method buyItemByType.

@ReactMethod
public void buyItemByType(String type, String sku, Promise promise) {
    addPromiseForKey(PROMISE_BUY_ITEM, promise);
    BillingFlowParams flowParams = BillingFlowParams.newBuilder().setSku(sku).setType(type).build();
    int responseCode = mBillingClient.launchBillingFlow(getCurrentActivity(), flowParams);
    Log.d(TAG, "buyItemByType (type: " + type + ", sku: " + sku + ") responseCode: " + responseCode + "(" + getBillingResponseCodeName(responseCode) + ")");
}
Also used : BillingFlowParams(com.android.billingclient.api.BillingFlowParams) ReactMethod(com.facebook.react.bridge.ReactMethod)

Aggregations

BillingFlowParams (com.android.billingclient.api.BillingFlowParams)6 ReactMethod (com.facebook.react.bridge.ReactMethod)1