Marmalade
Contents
1 POKKT SDK v6.0 Integration Guide for Marmalade (Android)
1.1 Overview
1.2 Project Configuration
1.2.1 Dependencies
1.2.2 Manifest
1.2.2.1 Permissions Declarations
1.2.2.2 Activity Declaration
1.2.2.3 Service Declaration
1.3 Implementation Steps
1.3.1 SDK Configuration
1.3.2 Ad Types
1.3.2.1 Video
1.3.2.1.1 Rewarded
1.3.2.1.2 Non Rewarded
1.3.2.2 Interstitial
1.3.2.2.1 Rewarded
1.3.2.2.2 Non Rewarded
1.3.2.3 Banner
1.3.3 Ad Actions
1.3.3.1 Video
1.3.3.2 Interstitial
1.3.3.3 Banner
1.3.4 Pokkt ad player configuration
1.3.5 User Details
1.3.6 Debugging
1.3.7 Analytics
1.3.7.1 Google Analytics
1.3.7.2 Flurry Analytics
1.3.7.3 MixPanel Analytics
1.3.7.4 Fabric Analytics
1.3.8 IAP(In App Purchase)
1.4 Pokkt Dashboard
1.4.1 InApp Notifications
1.4.1.1 Create notifications
POKKT SDK v6.0 Integration Guide for Marmalade (Android)
Last Update: 24th February, 2017
Download Latest Version Here with PDF Documentation v6.0.
Overview
Thank you for choosing Pokkt SDKfor Maramalade. 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.
In the package PokktNativeExtension.zipdownloaded above you will find:
Docs:
Contains documentations for step wise step integration for SDK.
PokktAds Demo:
Source code for PokktAds Demo(Sample app) which showcase implementation of Pokkt SDK through code for better understanding.
PokktAds Demo.apk:
Application package of PoktkAds Demo, so that you can directly install this apk on your device and have a look how our SDK works instead of compiling the source code.
Pokkt Native Extension:
It is the extension project for Pokkt SDK which will be added in main project as sub project in .mkb file
minSdkVersionsupported is 11 .
ScreenName: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.
We will be referencing PokktAds Demoapp provided with SDK. We will be referencing this app during the course of explanation in this document. We suggest you go through the sample app for better understanding.
Project Configuration
Dependencies
Add Pokkt Native Extension to your project to your "subprojects".
We expect Google play servicesintegrated in project, although it;s optional but we recommend you to integrate it, as it’s required to fetch AdvertisingIDfor device,which is useful to deliver targeted advertising to Android users.
Manifest
Permissions Declarations
Add the following permissions to your project manifest
Mandatory permissions.
android.permission.INTERNET = Required for SDK communication with server.
android.permission.READ_PHONE_STATE = Required for creating unique identifier for you application based on the unique id of the device like IMEI.
Optional permissions.
android.permission.ACCESS_NETWORK_STATE = Required to detect changes in network, like if WIFI is available or not.
android.permission.ACCESS_WIFI_STATE = Required to detect changes in network, like if WIFI is available or not.
android.permission.CHANGE_WIFI_STATE = Required to detect changes in network, like if WIFI is available or not.
android.permission.WAKE_LOCK = Required to prevent device from going into the sleep mode during video play.
android.permission.WRITE_EXTERNAL_STORAGE = Required to store media files related to ads in external SD card, if not provided we will use app cache folder to store media files, which will result in unnecessary increase in application’s size. It is recommended to ask for this permission as low end devices generally have less internally memory available.
android.permission.WRITE_CALENDAR = Some Ads create events in calendar.
android.permission.ACCESS_COARSE_LOCATION" = Some Ads show content based on user’s location.
android.permission.ACCESS_FINE_LOCATION = Some Ads show content based on user’s location.
android.permission.CALL_PHONE = Some Ads are interactive and they provide you a way to call directly from the content.
android.permission.SEND_SMS = Some Ads are interactive and they provide you a way to send message.
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.
Service Declaration
Add the following service in your AndroidManifest for receiving InApp notifications. How to set up InApp notifications.
Implementation Steps
SDK Configuration
You need to set extension before calling any method like below. This should be the first call.
Set Application Idand Security keyin Pokkt SDK. You can get it from Pokkt dashboard from your account. We generally assign unique application Id and Security key.
If you are using server to server integration with Pokkt, you can also set Third Party UserIdin PCPokktAds.
When your application is under development and if you want to see Pokkt logs and other informatory messages, you can enable it by setting shouldDebugto true. Make sure to disable debugging before release.
Ad Types
Video
Video ad can be rewarded or non-rewarded. You can either cache the ad in advance or directly call show for it.
We suggest you to 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.
Rewarded
To cache rewarded ad call:
To show rewarded ad call:
Non Rewarded
To cache non-rewarded ad call:
To show non-rewarded ad call:
You can check if ad is available or not before making c ache or show request.
Interstitial
Rewarded
To cache rewarded ad call:
To show rewarded ad call:
Non Rewarded
To cache non-rewarded ad call:
To show non-rewarded ad call:
You can check if ad is available or not before making c ache or show request.
There are two ways to load banners:
Load banner
There are predefined positions for banner positioning inside BannerPosition( Com. Pokkt.Plugin.Common.BannerPosition ).
TOP_LEFT.
TOP_CENTER.
TOP_RIGHT.
MIDDLE_LEFT.
MIDDLE_CENTER.
MIDDLE_RIGHT.
BOTTOM_LEFT.
BOTTOM_CENTER.
BOTTOM_RIGHT.
Load banner with rect
Height: Custom height for banner. Width: Custom width for banner. x: Point x on screen to show banner. y: Point y on screen to show banner.
You can remove Banner using:
You can also set banner to auto-refresh using:
Ad Actions
Ad actions are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.
Video
Interstitial
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 PokktAdPlayerViewConfig.
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 Teamto do the same for your app through admin console.
Various properties that can be managed through this are:
Back button Defines if user is allowed to close the Advertisement by clicking on back button or not. Property Name: 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.
Default skip time Defines the time after which user can skip the Ad. Property name:DefaultSkipTime Values: Any Integer value. Default value is 10 seconds.
Should allow skip Defines if user is allowed to skip the Ad or not. Property name:ShouldAllowSkip Values: True = User can skip Ad. False = User can’t skip Ad.
Should allow mute Defines if user is allowed to mute the Video Ad or not. Property name:ShouldAllowMute Values: True = User can mute video Ad. False = User can’t mute video Ad.
Should confirm skip Defines if confirmation dialog is to be shown before skipping the Ad. Property name:ShouldConfirmSkip Values: True = Confirmation dialog will be shown before skipping the video. False = Confirmation dialog will not be shown before skipping the video.
Skip confirmation message Defines what confirmation message to be shown in skip dialog. Property name:SkipConfirmMessage Values: Any String message. Default value is “Skipping this video will earn you NO rewards. Are you sure?”.
Affirmative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Property name:SkipConfirmYesLabel Values: Any String message. Default value is “Yes”.
Negative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Property name:SkipConfirmNoLabel Values: Any String message. Default value is “No”.
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. Property name:SkipTimerMessage Values: Any String message. Default value is “You can skip video in ## seconds”
Incentive message Defines message to be shown during video progress, that after what time user will be incentivised. Property name:IncentiveMessage Values: Any String message Default value is “more seconds only for your reward !”
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.
User Details
For better targeting of ads you can also provide user details to our SDK using.
Debugging
Other than enabling debugging for Pokkt SDK, it can also be used to:
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.
Export log to cloud
You can also export log to cloud.
Analytics
We support various analytics in Pokkt SDK.
Below is mentioned how to enable various analytics with Pokkt SDK.
Google Analytics
Google analytics Id can be obtained from Google dashboard.
Flurry Analytics
Flurry application key can be obtained from Flurry dashboard.
MixPanel Analytics
MixPanel project token can be obtained from MixPanel dashboard.
Fabric Analytics
Analytics Id is not required in case of Fabric.
IAP(In App Purchase)
Call trackIAP to send any In App purchase information to Pokkt.
Pokkt Dashboard
InApp Notifications
Open developer dashboard -> Manage App -> Notifications
Create notifications
Basic notification information required.
Name:
A friendly name for notification. It will help you to distinguish between different notifications.
App:
Select your app for which you want to assign notifications.
Platform:
Select OS platform for which you want to target notifications.
Countries:
Select countries where this notifications will be shown to users. Let’s say if you have users in multiple countries, you can selectively target notifications to them.
App version:
Enter your app version for which you want to show notifications. Let’s say you have multiple version installed among users and you want to send different notifications to different users based on their versions.
Last seen:
Set minimum and maximum limit in days for which user can remain away from the app. Let’s say if min = 2 and max = 4, and user hasn’t open your app for atleast 2 days, you can remind by showing notification, but if 4 days have passed app will not show any more notifications to user.
Message:
Message you want to show in notifications bar.
Title:
Title for the notification to be shown in notification bar.
Schedule notification
Daily
Weekly
Monthly
Last updated
