POKKT SDK Integration Guide v8.2.0 Android

Overview

Thank you for choosing Pokkt SDK for Android. This document contains all the information required to setup the SDK with your project.

Before implementing plugins it is mandatory to go through project configuration and implementation steps, as these sections contain mandatory steps for basic SDK integration.

You can download our SDK from pokkt.comarrow-up-right.

Downloaded SDK package will contain:

  1. PokktSDK_v8.2.0.aar : Pokkt SDK in aar format.

  2. Sample App using PokktSDK

Project Configuration

Add PokktSDK_v8.2.0.aar to your project app/libs folder and add the following line in your app level build.gradle file. minSdkVersion supported is 16.

dependencies {

implementation fileTree(include: [‘PokktSDK_v8.2.0.aar'], dir: ‘libs');

implementation ‘com.google.android.gms:play-services-ads:21.3.0’ //Optional

}

We expect Google play services integrated in project, although it is optional but we recommend you to integrate it, as it is required to fetch AdvertisingID for device, which is useful to deliver targeted advertising to Android users.

Adding Your Application to Your Pokkt Publisher's Account

This one parameter is accepted by almost all API’s of Pokkt SDK. This controls the placement of ads and can be created on Pokkt Dashboard.

Developer needs to create screens in Pokkt Developer account.

Implementation Steps

Set Application Id and Security key in Pokkt SDK. You can get it from Pokkt dashboard from your account. These are unique per app registered. This must be called before calling any other methods of Pokkt SDK.

PokktAds.setPokktConfig("<PokktAppID>","<PokktSecurityKey>","<Activity>");

FullScreen Ads

To cache FullScreen ad, call below method

PokktAds.cacheAd("<ScreenId>",<PokktAdDelegate>);

To show FullScreen ad, call below method

PokktAds.showAd(“<ScreenId>”,<PokktAdDelegate>, null);

To check if FullScreen ad is cached or not, call below method

PokktAds.isAdCached("<ScreenId>">);

Add Banner Ad View to layout

To show Banner ad, call below method

PokktAds.showAd("<screenId>", <PokktAdDelegate>, <pokktBannerView>);

To destroy Banner ad, call below method

PokktAds.destroyBanner(<pokktBannerView>);

To define PokktAdDelegate, refer below code

Test Ads

  • Application Id : f303768353fb89d188f24b36c4d80b2e

  • Security Key : f3b2bec2234694467398589e1606234b

  • Sample Screen Id for Video : 684ab1e66abeb060faa500136c4c6a74

  • Sample Screen Id for Interstitial : 5e59028c8332c9583e742c183abbaafb

  • Sample Screen Id for Banner : 129cc53b4666f5ae1ebad6a9bc942764

Debugging

When your application is under development and if you want to see Pokkt logs and other informatory messages, you can enable it by setting shouldDebug to true . Make sure to disable debugging before release.

Other than enabling debugging for Pokkt SDK, it can also be used to

export your log to your desired location.

PokktAds.Debugging.shouldDebug(“<Context Context>”,<true>);

PokktAds.Debugging.exportLog(getActivity());

Proguard

If you are using proguard in your app, add following rules to your proguard file.

FAQ

  • If you are using server to server integration with Pokkt, you can also set Third Party UserId in PokktAds.

PokktAds.setThirdPartyUserId("<Third party user Id>");

  • If you want to set GDPR consent in Pokkt SDK. This must be called before calling any ad related API. Developers/Publishers must get the consent from user. This API can again be used by publishers to revoke the consent. If this API is not called or invalid data provided then SDK will access the users personal data for ad targeting.

  • If Developer want to set some values in POKKT SDK that they need to be sent to their server via POKKT Server callbacks.

Map<String, String> params = new HashMap<>(); params.put("testdata","{\"adnetwork\": \"pokkt\"}"); PokktAds.setCallbackExtraParams(params);

  • FullScreen Ads are of two types : Video and Interstitial. It can be rewarded or non rewarded. Its properties can be configured from the Pokkt dashboard. You can either cache the ad in advance or directly call show for it. We suggest you cache the ad in advance so as to give seamless play behaviour, In other case it will stream the video which may lead to unnecessary buffering delays depending on the network connection.

  • For better targeting of ads you can also provide user details to our SDK using below code.

Last updated