C. Other Functions

1) TnkSession.queryPublishState()

When you stop publishing ads, no ads will not be displayed in offerwall. For good user experience, you had better hide offerwall buttons when your app is not in publishing state. This method inquiries current state of your app in async way.

Method 
  - void TnkSession.queryPublishState(Context context, boolean showProgress, ServiceCallback callback)

Description
   This method returns current state of your app. This method works asynchronously and delivers return values to ServiceCallback object you passed in. You should invoke this method in main UI thread. Return value is delivered to the second parameter of onReturn(Context context, Object result) method of callback object. Callback is executed in main UI thread.

Parameters
 Parameter  Description
 context Activity or Context object 
 showProgress  shows progress dialog or not.

 callback  ServiceCallback object in which return value is delivered. Return value is an Integer object representing publishing state. TnkSession.STATE_YES (1) means your apps is in publishing state.

Sample Code

final Button button = (Button)findViewById(R.id.main_ad);

// ... 

TnkSession.queryPublishState(this, false, new ServiceCallback() {

    @Override

    public void onReturn(Context context, Object result) {

        int state = (Integer)result;

        if (state == TnkSession.STATE_YES) {

            button.setVisibility(View.VISIBLE);

        }

    }

});


2) TnkSession.enableLogging()

Turn on or off SDK's logging output.

Method 
  - void TnkSession.enableLogging(boolean trueOrFalse)
Comments