Native Android
Contents
1 POKKT Native Android SDK v8.1.0 (GDPR Compliance)
2 Getting Started with Pokkt SDK v 8.1.0
3 Integration Guide v 8.1.0
3.1 Overview
3.2 Project Configuration
3.2.1 Dependencies
3.2.2 Manifest
3.2.2.1 Permissions Declarations
3.2.2.2 Activity Declaration
3.3 Implementation Steps
3.3.1 SDK Configuration
3.3.2 Ad Types
3.3.2.1 FullScreen Ads
3.3.2.2 Banner
3.3.2.3 Native Ads
3.3.3 Ad Delegates
3.3.3.1 FullScreen Ads
3.3.3.2 Native Ads
3.3.3.3 Banner
3.3.4 Pokkt ad player configuration
3.3.5 User Details
3.3.6 Pokkt Server Callback Params
3.3.7 Debugging
3.3.8 Proguard
4 Migration Note Guide v 8.1.0
4.1 Screen ID
4.2 AdTypes
4.3 Simpler APIs for full screen ads and banner ads.
4.4 Ad Delegates are changed. SetDelegate API is removed.
4.5 isAdCached API is changed.
4.6 Destroy Banner API is changed
4.7 Native Ad
5 Migration Note Guide v 7.6.0
5.1 Note
POKKT Native Android SDK v8.1.0 (GDPR Compliance)
Last Update: 28th October, 2021
Download Latest Version Here
Getting Started with Pokkt SDK v 8.1.0
1. Add "PokktSDK.aar" to your project.
2. 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.
3. Set the following to enable or disable omission of Pokkt logs and other informatory messages. Make sure to set it to false before release.
4. Set GDPR consent in Pokkt SDK. This must be called before calling any ad related API. Developers/Publishers must get the consent from user. For more information on GDPR please refer https://www.eugdpr.org/ and https://www.eugdpr.org/gdpr-faqs.html . 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.
5. You can check if Ad is cached or not using
6. Show FullScreen Ad with one of the following:
7. For Banner Ad
Define a container (PokktBannerView) for banner something like following:
To load banner, use:
Use the following to destroy banner:
8. Implement PokktAds.PokktAdDelegate to listen to fullscreen-ad related messages. 9. Implement PokktAds.BannerAdDelegate to listen to banner-ad related messages. 10. We recommend caching of video-ads for better user experience, you can cache an ad using the following:
Integration Guide v 8.1.0
Overview
Thank you for choosing Pokkt SDK for Android. This document contains all the information required to set up the SDK with your project. We also support mediation for various third party networks. To know the supported third party networks and their integration process go to mediation section .
Before implementing plugins it is mandatory to go through project configuration and implementation steps, as these sections contain mandatory steps for basic SDK integration and are followed by every plugin.
You can download our SDK from pokkt.com.
Downloaded SDK package will contain:
Docs:
Contains documentations for step wise step integration for SDK.
PokktSDK_v 8.1.0.jar
Pokkt SDK in jar format.
PokktSDK_v 8.1.0.aar
Pokkt SDK in aar format.
Pokktsdk360ext.jar / Pokktsdk360ext.aar
Add these if you want to support 360 video ads.
PokktAds Demo
Source code for PokktAds Demo(Sample app) which showcase implementation of Pokkt SDK through code for better understanding.
Dependency jars:
Please add google play services and support-v4 jar.
minSdkVersion supported is 11 .
ScreenId: 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.
We will be referencing PokktAds Demo app provided with SDK during the course of explanation in this document. We suggest you go through the sample app for better understanding.
Project Configuration
Dependencies
Add PokktSDK_v 8.1.0.jar or PokktSDK_v 8.1.0.aar to your project.
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.
Manifest
Android 9.0 (API 28) blocks cleartext (non-HTTPS) traffic by default , which can prevent ads from serving correctly.To mitigate that, publishers whose apps run on Android 9.0 or above should ensure to add a network security config file or you should set the usesCleartextTraffic attribute in your application tag to true. Doing so whitelists cleartext traffic and allows non-HTTPS ads to serve.
Permissions Declarations
Add the following permissions to your project manifest
1. Mandatory permissions.
android.permission.INTERNET = Required for SDK communication with server.
android.permission.ACCESS_NETWORK_STATE = Required to detect changes in network, like if WIFI is available or not.
Activity Declaration
Add the following activity in your AndroidManifest for Pokkt SDK integration.
You can change the android:screenOrientation="landscape" to of your choice, the way you want to display the ads.
Implementation Steps
SDK Configuration
1. 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.
2. If you are using server to server integration with Pokkt, you can also set Third Party UserId in PokktAds.
3. 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.
4. Set GDPR consent in Pokkt SDK. This must be called before calling any ad related API. Developers/Publishers must get the consent from user. For more information on GDPR please refer https://www.eugdpr.org/ and https://www.eugdpr.org/gdpr-faqs.html . 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.
Ad Types
FullScreen Ads
FullScreen Ads are of two types : Video and Interstitial.
FullScreen ads can be rewarded or non-rewarded.
FullScreen 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.
1. To cache FullScreen ad call:
2. To show FullScreen ad call:
3. You can check if FullScreen ad is cached or not using
Sample Screen Id for Video : 684ab1e66abeb060faa500136c4c6a74
Sample Screen Id for Interstitial : 5e59028c8332c9583e742c183abbaafb
Add PokktBannerView to your layout, we use it as a placeholder to populate banner ads into it.
Load banner
You can remove Banner using:
Sample Screen Id for Banner : 129cc53b4666f5ae1ebad6a9bc942764
Native Ads
A native ad is a type of ad which contains ad assets and developer app displays the ad assets as per the format of the app UI. Normally, FullScreen ads are delivered on call to action by the user. Native ads eliminate this limitation and show ads without any user request.Native ads are also non intrusive as they will be automatically paused when the ad is out of the view by scrolling. A naIve ad may be served in feed or in between the developer content inside the app. The PokktNaIveAdLayout displays the media asset.
Add Native Ad Layout to your Layout XML. The view hierarchy will be as below. You need to modify these as per your layout design.
Request for native Ad.
Once PokktNativeAd is received in the AdReady callback of NativeAdsDelegate implementaIon, ad assets present in PokktnativeAd should be used to populate the ad UI.
Developers must implement NativeAdsDelegate and supply POKKT SDK in requestNativeAd().
Developers will have to do cleanup of Native Ad in onDestroy of activity life cycle.
Please refer to our Pokkt Ads Demo Source code for sample implementation of Native Ads in List, Scroll and WebView
Sample Screen Id for Native Ad with Image asset : 377d86e7fae5f5714375824636468a42
Sample Screen Id for Native Ad with video asset : fad058c08a41ef4506e759bce521bcbb
Ad Delegates
FullScreen Ads
Ad delegates are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.
Native Ads
Developers should implement SDK Native Ad delegates and supply POKKT SDK in requestNativeAd().
Ad delegates are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.
Pokkt ad player configuration
Pokkt Ad player works the way App is configured at Pokkt dashboard, but we provide a way to override those settings using PokktAdViewConfig.
Application should prefer configuration provided through code by developer or what’s configured for the app in dashboard, can be controlled any time through the dashboard itself. If you want to make changes to this configuration after your app distribution, you can contact Pokkt Team to do the same for your app through admin console.
Various setters for the properties that can be managed through this are:
1. Back button Defines if user is allowed to close the Advertisement by clicking on back button or not. Setter Name: setBackButtonDisabled(boolean backButtonDisabled) Values: True = Back button is disabled and user cannot close the Ad. False = Back button is not disabled and user can close the Ad.
2. Default skip time Defines the time after which user can skip the Ad. Setter name: setDefaultSkipTime(int defaultSkipTime) Values: Any Integer value. Default value is 10 seconds.
3. Should allow skip Defines if user is allowed to skip the Ad or not. Setter name: setShouldAllowSkip(boolean shouldAllowSkip) Values: True = User can skip Ad. False = User can’t skip Ad.
4. Should allow mute Defines if user is allowed to mute the Video Ad or not. Setter name: setShouldAllowMute(boolean shouldAllowMute) Values: True = User can mute video Ad. False = User can’t mute video Ad.
5. Should confirm skip Defines if confirmation dialog is to be shown before skipping the Ad. Setter name: ShouldConfirmSkip Values: True = Confirmation dialog will be shown before skipping the video. False = Confirmation dialog will not be shown before skipping the video.
6. Skip confirmation message Defines what confirmation message to be shown in skip dialog. Setter name: setShouldSkipConfirm(boolean shouldSkipConfirm) Values: Any String message. Default value is “Skipping this video will earn you NO rewards. Are you sure?”.
7. Affirmative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Setter name: setSkipConfirmYesLabel(String skipConfirmYesLabel) Values: Any String message. Default value is “Yes”.
8. Negative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Setter name: setSkipConfirmNoLabel(String skipConfirmNoLabel) Values: Any String message. Default value is “No”.
9. Skip timer message Defines message to be shown before enabling skip button. Don’t forget to add placeholder “ ## ” in your custom message. This placeholder is replaced by property “Default skip time” assigned above. Setter name: setSkipTimerMessage(String skipTimerMessage) Values: Any String message. Default value is “You can skip video in ## seconds”
10. Incentive message Defines message to be shown during video progress, that after what time user will be incentivised. Setter name: setIncentiveMessage(String incentiveMessage) Values: Any String message Default value is “more seconds only for your reward !”
11. Should collect feedback Defines message to be shown during video progress, that after what time user will be incentivised. Property name setShouldCollectFeedback Values: True = If you want to collect feedback from the user for the Ad. False = If you don’t want to collect feedback from the user for the Ad.
12. Audio Enabled Provides a medium to disable audio for video ad without user interaction. Property name setAudioEnabled Values: True = If you want to play audio for video ad. False = If you don’t want to play audio for video ad.
User Details
For better targeting of ads you can also provide user details to our SDK using.
Pokkt Server Callback Params
Developer can set some values in POKKT SDK that they need to be sent to their server via POKKT Server callbacks.
Debugging
Other than enabling debugging for Pokkt SDK, it can also be used to:
1. 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.
2. Export log Export your log to your desired location, we generally have it in root directory of SD card, if permission for external storage is provided and in cache folder otherwise.
3. Export log to cloud You can also export log to cloud.
Proguard
If you are using proguard in your app, add following rules to your proguard file.
Migration Note Guide v 8.1.0
In case of any query regarding integration, refer “POKKT_SDK_Integration_Guide(_v8.1.0_Native_Android)” for this version provided inside “PokktSDK_v8.1.0”.
Screen ID
ScreenId is accepted by almost all API’s of Pokkt SDK. This controls the placement of ads and can be created on Pokkt Dashboard. This replaced Screen Name used earlier.
AdTypes
Rewarded Video ads and Interstitial Ads are merged into full screen ad type and ad type can be changed in runtime by editing the screen id Ad type.
Simpler APIs for full screen ads and banner ads.
Ad Delegates are changed. SetDelegate API is removed.
isAdCached API is changed.
Native Ad
Native Ads are introduced which replaces OutStream ads. Please refer our documentation for details.
Migration Note Guide v 7.6.0
Note
In case of any query regarding integration, refer POKKT_SDK_Integration_Guide(_v 7.6.0_Native_Android) for this version provided inside PokktSDK_v 7.6.0.
1. Removed callbacks videoAdAvailabilityStatus and interstitialAvailabilityStatus are removed from the Video and Interstitial ads respectively and so are the checkAdAvailability API.
2. PokktAdPlayerViewConfig PokktAdPlayerViewConfig is renamed to PokktAdViewConfig.
3. Activity context required in setPokktConfig.
4. Context required in shouldDebug.
Last updated
