Marmalade ios

Revision as of 06:21, 15 May 2017 by Madhu (talk | contribs) (POKKT SDK v6.0 Integration Guide for Marmalade (iOS))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

POKKT SDK v6.0 Integration Guide for Marmalade (iOS)

Last Update: 24th February, 2017

Download Latest Version Here v6.0.


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

In the package PokktNativeExtension.zipdownloaded above you will find:

  1. Docs:

    Contains documentations for step wise step integration for SDK.

  2. PokktAds Demo:

    Source code for PokktAds Demo(Sample app) which showcase implementation of Pokkt SDK through code for better understanding.

  3. 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.

  4. 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.

Implementation Steps

SDK Configuration

  1. You need to set extension before calling any method like below. This should be the first call.

  2. 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.

    PCPokktAds::setPokktConfig("<Pokkt Application ID>", "<Pokkt Security Key>");
  3. If you are using server to server integration with Pokkt, you can also set Third Party UserIdin PCPokktAds.

    PCPokktAds::setThirdPartyUserId("<Third party user Id>");
  4. 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 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.
  1. To cache rewarded ad call:

  2. To show rewarded ad call:

Non Rewarded
  1. To cache non-rewarded ad call:

  2. To show non-rewarded ad call:


You can check if ad is available or not before making c ache or show request.

  1. To cache rewarded ad call:

  2. To show rewarded ad call:

Non Rewarded
  1. To cache non-rewarded ad call:

  2. 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:

  1. Load banner

    PCPokktAds::loadBanner(<screenName>”, <BannerPosition>);

    There are predefined positions for banner positioning inside BannerPosition( Com. Pokkt.Plugin.Common.BannerPosition ).

    • TOP_LEFT.
    • TOP_RIGHT.
  2. 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.

  3. You can remove Banner using:

  4. 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.

PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdAvailability), this);
SELECTOR(VideoAdsView::handleAdCachingCompleted), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdCachingFailed), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdDisplayed), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdSkipped), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdCompleted), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdClosed), this);
PC_ADS_EVENT_SELECTOR(VideoAdsView::handleAdGratified), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdAvailability), this);
SELECTOR(InterstitialAdsView::handleAdCachingCompleted), this);
CTOR(InterstitialAdsView::handleAdCachingFailed), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdDisplayed), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdSkipped), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdCompleted), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdClosed), this);
PC_ADS_EVENT_SELECTOR(InterstitialAdsView::handleAdGratified), this);
PC_ADS_EVENT_SELECTOR(BannerAdsView::handleBannerLoadSuccessfuly), this);

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.

PokktAdPlayerViewConfig adPlayerViewConfig = new PokktAdPlayerViewConfig ();
// set properties values to adPlayerViewConfig

Various properties that can be managed through this are:

  1. Default skip time
    Defines the time after which user can skip the Ad.
    Property name:DefaultSkipTime
    Any Integer value.
    Default value is 10 seconds.
  2. Should allow skip
    Defines if user is allowed to skip the Ad or not.
    Property name:ShouldAllowSkip
    True = User can skip Ad.
    False = User can’t skip Ad.
  3. Should allow mute
    Defines if user is allowed to mute the Video Ad or not.
    Property name:ShouldAllowMute
    True = User can mute video Ad.
    False = User can’t mute video Ad.
  4. Should confirm skip
    Defines if confirmation dialog is to be shown before skipping the Ad.
    Property name:ShouldConfirmSkip
    True = Confirmation dialog will be shown before skipping the video.
    False = Confirmation dialog will not be shown before skipping the video.
  5. Skip confirmation message
    Defines what confirmation message to be shown in skip dialog.
    Property name:SkipConfirmMessage
    Any String message.
    Default value is “Skipping this video will earn you NO rewards. Are you sure?”.
  6. Affirmative label for skip dialog
    Defines what should be the label for affirmative button in skip dialog.
    Property name:SkipConfirmYesLabel
    Any String message.
    Default value is “Yes”.
  7. Negative label for skip dialog
    Defines what should be the label for affirmative button in skip dialog.
    Property name:SkipConfirmNoLabel
    Any String message.
    Default value is “No”.
  8. 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
    Any String message.
    Default value is “You can skip video in ## seconds”
  9. Incentive message
    Defines message to be shown during video progress, that after what time user will be incentivised.
    Property name:IncentiveMessage
    Any String message
    Default value is “more seconds only for your reward !”
  10. Should collect feedback
    Defines message to be shown during video progress, that after what time user will be incentivised.
    Property name:setShouldCollectFeedback
    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.

PCPokktUserDetails* pokktUserDetails = new PokktUserDetails();
pokktUserDetails -> name =" ";
pokktUserDetails -> age = " ";
pokktUserDetails -> sex = " ";
pokktUserDetails -> mobileNumber = " ";
pokktUserDetails -> emailAddress = " ";
pokktUserDetails -> location = " ";
pokktUserDetails -> birthday = " ";
pokktUserDetails -> maritalStatus = " ";
pokktUserDetails -> facebookId = " ";
pokktUserDetails -> twitterHandle = " ";
pokktUserDetails -> education = " ";
pokktUserDetails -> nationality = " ";
pokktUserDetails -> employment = " ";
pokktUserDetails -> maturityRating = " ";


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

  1. 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.

  2. Export log to cloud

    You can also export log to cloud.



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.

PCPokktAnalyticsDetails* analyticsDetail = new AnalyticsDetails();
analyticsDetail->eventType = “GOOGLE_ANALYTICS”;
analyticsDetail->googleAnalyticsID( "<Google Analytics Id>");
Flurry Analytics

Flurry application key can be obtained from Flurry dashboard.

PCPokktAnalyticsDetails* analyticsDetail = new AnalyticsDetails();
analyticsDetail->eventType = ”FLURRY”;
analyticsDetail->flurryApplicationKey("<Flurry Application Key>");
MixPanel Analytics

MixPanel project token can be obtained from MixPanel dashboard.

PCPokktAnalyticsDetails* analyticsDetail = new AnalyticsDetails();
aanalyticsDetail->eventType = “MIXPANEL”;
analyticsDetail->mixPanelProjectToken( "<MixPanel Project Token>");
Fabric Analytics

Analytics Id is not required in case of Fabric.

PCPokktAnalyticsDetails* analyticsDetail = new AnalyticsDetails();
analyticsDetail->eventType = “FABRIC”;

IAP(In App Purchase)

Call trackIAP to send any In App purchase information to Pokkt.

PCIAPDetails* pcIAPDetails = new PCIAPDetails();
pcIAPDetails -> productId("<productId>");
pcIAPDetails -> purchaseData("<purchaseData>");
pcIAPDetails -> purchaseSignature("<purchaseSignature>");
pcIAPDetails -> purchaseStore(IAPStoreType.GOOGLE);
pcIAPDetails -> price(<100.00>);
PCPokktAds :: setTrackIAP(pcIAPDetails );

Pokkt Dashboard

InApp Notifications

Open developer dashboard -> Manage App -> Notifications

Create notifications
  1. Basic notification information required.


    1. Name:

      A friendly name for notification. It will help you to distinguish between different notifications.

    2. App:

      Select your app for which you want to assign notifications.

    3. Platform:

      Select OS platform for which you want to target notifications.

    4. 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.

    5. 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.

    6. 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.

    7. Message:

      Message you want to show in notifications bar.

    8. Title:

      Title for the notification to be shown in notification bar.


  2. Schedule notification