Skip to content Skip to sidebar Skip to footer

A User Is Somehow Accessing Pro Features In The Free Version

I have constants set up for my Flavor names: public static final String FLAVOR_NAME_PRO = 'pro'; public static final String FLAVOR_NAME_FREE = 'free'; Inside my Activity's onCreat

Solution 1:

if (mUsingProFlavor) {
 customerId = getCustomerId();
 Intent intent = new Intent(MainActivity.this, CustomerProfileActivity.class);
                intent.putExtra("customerId", customerId);
                startActivity(intent);
 } else {
    showProOnlyFeatureAlertDialog(MainActivity.this, mAlertDialog);
}

Your -> if(mUsingProFlavor) is the issue here. Since mUsingProFlavor is a String, you have to modify your if-check. Currently it is acting as boolean.

if (mUsingProFlavor.equals("pro")) {
 customerId = getCustomerId();
 Intent intent = new Intent(MainActivity.this, CustomerProfileActivity.class);
                intent.putExtra("customerId", customerId);
                startActivity(intent);
 } else {
    showProOnlyFeatureAlertDialog(MainActivity.this, mAlertDialog);
}

Post a Comment for "A User Is Somehow Accessing Pro Features In The Free Version"