Skip to content Skip to sidebar Skip to footer

Google In App Billing Differentiate User Accounts

I'm developing an app that contains In App Billing non consumable product (Life time Subscription). User has one email associated with Play Store on his device. Scenario: User A c

Solution 1:

If you are using Firebase authentication then you can get user's unique id using String uid = FirebaseAuth.getInstance().getCurrentUser().getUid() and you can use this Id at the time of purchase like -

BillingFlowParamsbillingFlowParams= BillingFlowParams.newBuilder()
                .setSkuDetails(skuDetails).setObfuscatedAccountId(uid)
                .build();
        BillingResultbillingResult= billingClient.launchBillingFlow(activity, billingFlowParams);

Also in your database use this as unique identifier to check whether user has the subscriotion or not.

Post a Comment for "Google In App Billing Differentiate User Accounts"