Domanda

I can't purchase in-app content for my app because I'm using the same account on my phone as on Google Developer page.

If the user purchases the "premium" add-on for my app it enables some extra features.

Like this:


 if(premium == true){
 enable extra features...
 }

Is there some way check if the user is a developer?


 if(developer == true){
 enable extra features...
 }

È stato utile?

Soluzione

You can try this one.. Get account from device and in case this is tour account allow the features

premission:

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Code:

Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+
Account[] accounts = AccountManager.get(context).getAccounts();
for (Account account : accounts) {
    if (emailPattern.matcher(account.name).matches()) {
        String possibleEmail = account.name;
        ...
    }
}

Something like that.. Hope that helps

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top