1) Set user nameYou have to set user identification string using this API. Login Id is good for identification string.
If you don't have any user identification string, device Id will be fine for this. But please be sure to encrypt these strings when you are to use user's privacy data for identification string such as device Id, phone number and email.
These user identification strings are sent back to your server in parameters of callbacks and you can identify users using these strings. See
1.6 Callback URL for detail.
(If you set 'Point Management' as 'Managed by Tnk' in the page of publishing configuration, you may skip this step.)
Method
- void TnkSession.setUserName(Context context, String userName)
Parameters
2) Show Offerwall (Activity)Launch a offerwall activity.Method
- void TnkSession.showAdList(Context context)
- void TnkSession.showAdList(Context context, String title)
- void TnkSession.showAdList(Context context, String title, TnkLayout userLayout)
Parameters
3) Show Offerwall (View)Launch a offer wall as popup view.Method
- void TnkSession.popupAdList(Activity activity)
- void TnkSession.popupAdList(Activity activity, String title)
- void TnkSession.popupAdList(Activity activity, String title, TnkAdListener listener)
- void TnkSession.popupAdList(Activity activity, String title, TnkAdListener listener, TnkLayout userLayout)
Parameters
4) AdListViewAdListView is a View that provides offerwall functions. Developers can create a AdListView object using createAdListView() API.
- creating AdListView
Method
- AdListView TnkSession.createAdListView(Context context, boolean popupStyle)
- AdListView TnkSession.createAdListView(Context context, TnkLayout userLayout)
Parameters
5) APIs for AdListview
- void loadAdList()
- void show(Activity activity)
- void setTitle(String title)
- void setListener(TnkAdListener listener)
- void setAnimationType(int showType, int hideType)
Sample code
5) TnkAdListenerIf you want to get notified when AdListView is shown and disappears, use TnkAdListener interface.
TnkAdListener is originally invented for Interstitial Ad (see 4. Interstitial Ad) but you can also use for AdListview only for onShow() and onClose() event.
|