V2 AppLicenseChecker

public abstract class AppLicenseChecker extends Object
java.lang.Object

↳ com.onestore.extern.licensing.AppLicenseChecker

ALC Library和使用者應用程式代碼間通訊的主要通訊埠。

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 {
    ...
}

設定透過AppLicenseChecker.get()接收 publicKey和回應結果之 LicenseCheckerListener。

Summary


Nested classes

@interface

Public methods


get

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

生成AppLicenseChecker的instance

Parameters:

context

使用於透過 applicationContext 與登錄模組連接。

base64PublicKey

base64PublicKey

listener

Returns:

AppLicenseChecker

queryLicense

@AnyThread
public abstract void queryLicense()

呼叫queryLicense API時,同時進行緩存快取策略。 一般情况下,透過ONE store伺服器接收使用者購買記錄的License,但無法造訪ONE store伺服器時,使用本地緩存快取License訊息以確保有效期限內正常運作。 考慮網路問題或使用飛航模式的客戶,建議使用相應的 API 。

strictQueryLicense

@AnyThread
public abstract void strictQueryLicense()

呼叫strictQueryLicense API時,不使用換存快取的授權訊息。 因為無法造訪 ONE store伺服器,使用者無法使用應用程式 。

destroy

@AnyThread
public abstract void destroy()

中斷與ONE store伺服器連接

Last updated