First of all import the library in your gradle file.
compile 'com.myappfree.sdk:appvalidator:+'
Add this code to your MainActivity and add in the validated() block your logic to unlock your content.
AppValidator.isIapToUnlock(this, new AppValidator.OnAppValidatorListener() {
@Override
public void validated() {
// ADD YOUR UNLOCK LOGIC HERE
//...........
AppValidator.showDialog(MainActivity.this,"YOUR-CUSTOM-MESSAGE");
}
});
Use this line to show your custom message about unlocked content. This is mandatory to be approved from myAppFree Team.
AppValidator.showDialog(MainActivity.this,"YOUR-CUSTOM-MESSAGE");
Add this line before isIapToUnlock method.
AppValidator.DEBUG = true;
Note: this will raise the validated() block every time your app is opened. Remove this line before release your app to the store.