V2 AppLicenseChecker

public abstract class AppLicenseChecker extends Object
java.lang.Object

↳ com.onestore.extern.licensing.AppLicenseChecker

This is the primary interface for communication between the ALC library and the user application code.

class YourActivity extends AppCompatActivity {
     private AppLicensChecker mAppLicenseChecker;      
     
     @Override
     protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ...
        mAppLicenseChecker = AppLicenseChecker.get(MainActivity.this, getString(R.string.publick_key, new AppLicenseListener());
    }
...
}
 
private class AppLicenseListener implements LicenseCheckerListener {
    ...
}

Set the LicenseCheckerListener to receive the publicKey and response results through AppLicenseChecker.get().

Summary


Public methods


get

public static AppLicenseChecker get(Context context, String base64PublicKey, LicenseCheckerListener listener)

Create an instance of the AppLicenseChecker.

queryLicense

@AnyThread
public abstract void queryLicense()

When calling the queryLicense API, it will work in conjunction with the cache policy. Generally, a user's purchase history license is delivered through the ONE store server, but when access to the ONE store server is not possible due to network failures or airplane mode, a locally cached license is used to ensure execution until the expiration date.

We recommend using this API for customers who have network condition problems or who are on airplane mode.

strictQueryLicense

@AnyThread
public abstract void strictQueryLicense()

The cached license information is not used when calling the strictQueryLicense API. In this case, the user cannot use the app when the ONE store server is inaccessible. 

destroy

@AnyThread
public abstract void destroy()

Disconnecting from the ONE store service. 

Last updated