C. Other Functions

1) TnkSession - queryPublishState

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

[Async Invocation]

Method 
  - (void) queryPublishState:(id)target action:(SEL)action;

Parameters
 Name  Description
 target  Object in which the result value is delivered.
 action  SELECTOR with one (NSNumber *) parameter.
 See tnksdk.h file for the return values

Sample Code

- (void) publishStateReceived:(NSNumber *) state {

    // Check publishing state.

    if ([state integerValue] == TNK_STATE_YES) {

        // In publishing state -> show offerwall button

    }

    else {

        // Not in publishing state -> hide offerwall button

    }

}


- (void)viewWillAppear:(BOOL)animated

{

    [super viewWillAppear:animated];

    

    // 

    [[TnkSession sharedInstance] queryPublishState:self action:@selector(publishStateReceived:)];


}



[Sync Invocation]

Method 
  - (NSInteger) queryPublishState;

Return
  Return current state of your app. (See tnksdk.h in SDK)

Comments