GetTokenAsync

open class GetTokenAsync : AsyncTask<Params, Progress, Result>

AsyncTask for retrieving Huawei Mobile Services push token asynchronously.

Use this class when you need to manually retrieve the HMS push token for advanced scenarios such as manual registration or sending the token to your backend server. Example:


new PushwooshHmsHelper.GetTokenAsync(new PushwooshHmsHelper.OnGetTokenAsync() {

    
    public void onGetToken(String token) {
        // Token retrieved successfully
        PushwooshHmsHelper.onTokenRefresh(token);
    }

    
    public void onError(String error) {
        // Token retrieval failed
        Log.e("HMS", "Failed: " + error);
    }
}).execute();

See also

Constructors

Link copied to clipboard
constructor(onGetTokenAsync: PushwooshHmsHelper.OnGetTokenAsync)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun execute(p: Array<Params>): AsyncTask<Params, Progress, Result>
open fun execute(p: Runnable)
Link copied to clipboard
fun executeOnExecutor(p: Executor, p1: Array<Params>): AsyncTask<Params, Progress, Result>
Link copied to clipboard
fun get(): Result
Link copied to clipboard
fun getStatus(): AsyncTask.Status
Link copied to clipboard
Link copied to clipboard
protected open fun onCancelled(p: Result)
Link copied to clipboard
Link copied to clipboard
protected open fun onPreExecute()
Link copied to clipboard
protected open fun onProgressUpdate(p: Array<Progress>)
Link copied to clipboard
protected fun publishProgress(p: Array<Progress>)