# queryTokenInfo

open fun queryTokenInfo(@NonNull activity: Activity, @NonNull callback: GamebaseDataCallback<GamebasePushTokenInfo>)

Get push settings from the the push server.

Example Usage:

    Gamebase.Push.queryTokenInfo(activity, new GamebaseDataCallback<GamebasePushTokenInfo>() {
        @Override
        public void onCallback(GamebasePushTokenInfo data, GamebaseException exception) {
            if (Gamebase.isSuccess(exception)) {
                // Query push token info succeeded.
                String token = data.token;
                boolean enabledPush = data.agreement.pushEnabled;
                boolean enabledAdPush = data.agreement.adAgreement;
                boolean enabledAdPushNight = data.agreement.adAgreementNight;
            } else {
                // Query push token info failed.
            }
        }
    });

Content copied to clipboard

#### Since

Added 2.15.0.

#### Parameters

activity

Current activity.

callback

Callback pass to API result.

#### See also

GamebasePushTokenInfo
GamebaseDataCallback