Difference between revisions of "Titanium ios"

From POKKT DOCUMENTATION
Jump to: navigation, search
(Created page with "== POKKT SDK v5.0 Integration Guide for Appcelerator (IOS) == Last Update: 18th November, 2016 ----- Download Latest Version Here with PDF Documentation [javascript:void(0...")
 
Line 1: Line 1:
 
== POKKT SDK v5.0 Integration Guide for Appcelerator (IOS) ==
 
== POKKT SDK v5.0 Integration Guide for Appcelerator (IOS) ==
  
Last Update: 18th November, 2016
+
<small>Last Update: 18th November, 2016</small>
 
 
 
 
-----
 
 
 
Download Latest Version Here with PDF Documentation [javascript:void(0); v5.0].
 
 
 
 
 
-----
 
 
 
[[#overview|Overview]]
 
 
 
[[#configurationsteps|Configuration Steps]]
 
 
 
[[#implementationsteps|Implementation Steps]]
 
 
 
* [[#common|Common]]
 
* [[#session|Session]]
 
* [[#rewardads|Rewarded/Non-Rewarded Ads]]
 
* [[#export|Export Logs]]
 
* [[#optionalparameters|Optional Parameters]]
 
  
 +
Download Latest Version Here with PDF Documentation [[ v5.0]].
  
 
-----
 
-----
Line 50: Line 31:
  
 
'''Note:'''Please do not copy the code points from this Doc/PDF file as it may introduce unwanted characters and space in your code. Instead please refer to sample app source code provided with the sample app.
 
'''Note:'''Please do not copy the code points from this Doc/PDF file as it may introduce unwanted characters and space in your code. Instead please refer to sample app source code provided with the sample app.
 
  
 
-----
 
-----
Line 62: Line 42:
  
 
In order to add this to you project, go to '''Help -> Install Mobile Module'''. Now point to '''com.pokkt.titaniumios-iphone-5.0.zip'''and press '''“Ok”'''. This should install the plugin in your project. Finally, copy '''pokkt_native_extension.js'''inside your Resource folder. Now the plugin should be ready for you to use with your project.
 
In order to add this to you project, go to '''Help -> Install Mobile Module'''. Now point to '''com.pokkt.titaniumios-iphone-5.0.zip'''and press '''“Ok”'''. This should install the plugin in your project. Finally, copy '''pokkt_native_extension.js'''inside your Resource folder. Now the plugin should be ready for you to use with your project.
 
  
 
-----
 
-----
Line 68: Line 47:
 
=== 3. Implementation Steps ===
 
=== 3. Implementation Steps ===
  
'''Common'''
+
====Common====
  
 
# For all invocation of Pokkt SDK developer will make use of methods available in '''pokktNativeExtension.js'''file using '''PokktExtension'''object.
 
# For all invocation of Pokkt SDK developer will make use of methods available in '''pokktNativeExtension.js'''file using '''PokktExtension'''object.
Line 84: Line 63:
 
# To use mix panel analytics please set '''selectedAnalyticsType'''to “FABRIC”.
 
# To use mix panel analytics please set '''selectedAnalyticsType'''to “FABRIC”.
  
<br />
+
====Session====
 
 
'''Session'''
 
  
 
# Invoke '''PokktExtension.startSession()'''at the start of his application and once only.
 
# Invoke '''PokktExtension.startSession()'''at the start of his application and once only.
 
# You should call'''PokktExtension.endSession()'''at the end of his application and once only.
 
# You should call'''PokktExtension.endSession()'''at the end of his application and once only.
  
<br />
+
====Rewarded/Non-Rewarded Ads====
 
 
'''Rewarded/Non-Rewarded Ads'''
 
  
 
# You will have to configure an '''adConfig'''object to request for any ad to be displayed. Get one using '''createAdConfig()'''method. It also provides options for customizing your ad-screen. It is recommended to have different '''adConfig'''objects for each screens. Followings are the values that you can set with '''adConfig:'''<br />
 
# You will have to configure an '''adConfig'''object to request for any ad to be displayed. Get one using '''createAdConfig()'''method. It also provides options for customizing your ad-screen. It is recommended to have different '''adConfig'''objects for each screens. Followings are the values that you can set with '''adConfig:'''<br />
Line 123: Line 98:
 
# Reward user ONLY from the ''''AdGratified'''' event.
 
# Reward user ONLY from the ''''AdGratified'''' event.
  
<br />
+
====Export Logs====
 
 
'''Export Logs'''
 
  
 
# Developer should call '''PokktExtension.exportLog()''' to export the Pokkt SDK logs to folder of your choice.
 
# Developer should call '''PokktExtension.exportLog()''' to export the Pokkt SDK logs to folder of your choice.
Line 131: Line 104:
 
# User can also create a new folder where user wants to export the logs.
 
# User can also create a new folder where user wants to export the logs.
  
<br />
+
====Optional Parameters====
 
 
'''Optional Parameters'''
 
  
 
'''PokktConfig''' also has provision for developers to provide extra user data available with them to Pokkt. We currently support following data points: '''Name, Age, Sex, MobileNo, EmailAddress, Location, Birthday, MaritalStatus, FacebookId, TwitterHandle, Education, Nationality, Employment'''and'''MaturityRating.'''
 
'''PokktConfig''' also has provision for developers to provide extra user data available with them to Pokkt. We currently support following data points: '''Name, Age, Sex, MobileNo, EmailAddress, Location, Birthday, MaritalStatus, FacebookId, TwitterHandle, Education, Nationality, Employment'''and'''MaturityRating.'''

Revision as of 12:51, 3 May 2017

POKKT SDK v5.0 Integration Guide for Appcelerator (IOS)

Last Update: 18th November, 2016

Download Latest Version Here with PDF Documentation v5.0.


1. Overview

Thank you for choosing Pokkt SDK Plugin v5.0 for Appcelerator. Pokkt SDK supports Video/Interstitial-Ad campaigns feature. This document contains all the information that is needed by you to setup the SDK with your project. The current plugin supports mediation for various third party ad-networks. These are:

  • AdColony
  • AppLovon
  • Chartboost
  • Fyber
  • InMobi
  • SuperSonic
  • UnityAds
  • TapJoy
  • Vungle
  • AdMob
  • Facebook
  • MoPub

A separate set of documents is provided for each of these, explaining the implementation process.

Kindly note that these instructions are for Appcelerator with Titanium SDK Version 5.x and above, older versions of are not supported.

There is a sample app provided with the SDK. We will be referencing this app during the course of explanation in this document. It is suggested that you should check that app to understand the following process in detail.

Note:Please do not copy the code points from this Doc/PDF file as it may introduce unwanted characters and space in your code. Instead please refer to sample app source code provided with the sample app.


2. Configuration Steps

There are three files that are provided and will be needed by you to use the plugin:

  1. com.pokkt.titaniumios-iphone-5.0.zip
  2. pokkt_native_extension.js

In order to add this to you project, go to Help -> Install Mobile Module. Now point to com.pokkt.titaniumios-iphone-5.0.zipand press “Ok”. This should install the plugin in your project. Finally, copy pokkt_native_extension.jsinside your Resource folder. Now the plugin should be ready for you to use with your project.


3. Implementation Steps

Common

  1. For all invocation of Pokkt SDK developer will make use of methods available in pokktNativeExtension.jsfile using PokktExtensionobject.
  2. Create a PokktConfigobject using creatPokktConfig()method, then provide applicationIdand securityKey, these are must for initializing Pokkt.
  3. Once you have your pokktConfig ready, invoke initPokktmethod before you invoke any other methods from the PokktExtension. This does not apply to session related methods namely startSession and endSessionand few utility methods.
  4. In order to know whether Pokkt is initialized or not, listen to ‘PokktInitialised’ event, if the provided Boolean parameter is true only then move ahead with other operations.
  5. If you are doing server to server integration with Pokkt you can also set thirdPartyUserIdin pokktConfigobject.
  6. Apart from above mentioned parameters you can assign additional ones based on your integration type. Refer to Offerwall and Video sections below.
  7. While in development please call PokktExtension.setDebug(true) to see Pokkt debug logs and toast messages. Make sure to change this to falsefor production build.
  8. Call PokktExtension.notifyAppInstall()to log your application installation information with Pokkt.
  9. Call PokktExtension.trackIAP(details)to log any in-app purchase details with Pokkt. Accepted values are (all caps): “NONE”, “GOOGLE”, “IOS”, “AMAZON”.
  10. To use google analytics, please set selectedAnalyticsType to “GOOGLE_ANALYTICS” and googleAnalyticsIDin pokktConfig.
  11. To use flurry analytics please set selectedAnalyticsTypeto “FLURRY” and flurryApplicationKeyin pokktConfig.
  12. To use mix panel analytics please set selectedAnalyticsTypeto “MIXPANEL” and mixPanelProjectTokenin pokktConfig.
  13. To use mix panel analytics please set selectedAnalyticsTypeto “FABRIC”.

Session

  1. Invoke PokktExtension.startSession()at the start of his application and once only.
  2. You should callPokktExtension.endSession()at the end of his application and once only.

Rewarded/Non-Rewarded Ads

  1. You will have to configure an adConfigobject to request for any ad to be displayed. Get one using createAdConfig()method. It also provides options for customizing your ad-screen. It is recommended to have different adConfigobjects for each screens. Followings are the values that you can set with adConfig:
    • screenName (Required): This controls the placement of ads and can be created on Pokkt Dashboard.
    • isRewarded (Required): Requested ad type. Ad gratification will happen only for rewarded ads.
    • adFormat (Required): Requested ad format. SDK supports Video, Interstitial and banner adFormats. Default is Video ad format.
    • backButtonDisabled:Disable ‘back’ button press while on ad-screen.
    • defaultSkipTime:If ad-skipping is allowed, this provides the seconds it will wait before the skip button appears.
    • shouldAllowSkip:Whether skipping-ad is allowed or not. If set to ‘false’, user will be forced to watch the ad till it finishes.
    • shouldAllowMute:Whether to allow sound-mute while on ad-screen, it controls the ‘mute’ button. Cannot contains whitespaces and only special characters allowed are hyphens (-) and underscores (_).
    • shouldConfirmSkip:Controls whether to show the skip-confirmation dialog box. If set to ‘false’, the ad will be silently closed without prompting for confirmation
    • skipConfirmMessage: The message that will appear on skip-confirmation dialog box.
    • skipConfirmYesLabel:‘Yes’ Label of skip-confirmation dialog box.
    • skipConfirmNoLabel: ‘No’ Label of skip-confirmation dialog box.
    • skipTimerMessage: The message on countdown-timer before the skip button appears. The message must contain a ‘##’-placeholder to show timer value.
    • incentiveMessage:If set, the message will be displayed while prompting user to watch the ad for certain time before it can be rewarded.
  2. Invoke PokktExtension.cacheAd(adConfig)to cache the ad on device. Cached-ads provide better user experience than streaming-ads
  3. You can call PokktExtension.checkAdAvailability(adConfig) to check if the adcampaigns are available or not. The result will be notified via 'AdAvailability'.
  4. Invoke PokktExtension.showAd(adConfig) to show ad.
  5. Following are ad-related events, you can refer to the provided sample-code to understand the ideal implementation on how to consume these:
    • AdCachingCompleted
    • AdCachingFailed
    • AdClosed
    • AdCompleted
    • AdDisplayed
    • AdSkipped
    • AdGratified
    • AdAvailability
  6. Reward user ONLY from the 'AdGratified' event.

Export Logs

  1. Developer should call PokktExtension.exportLog() to export the Pokkt SDK logs to folder of your choice.
  2. This API shows a folder chooser dialog where user can choose a particular folder.
  3. User can also create a new folder where user wants to export the logs.

Optional Parameters

PokktConfig also has provision for developers to provide extra user data available with them to Pokkt. We currently support following data points: Name, Age, Sex, MobileNo, EmailAddress, Location, Birthday, MaritalStatus, FacebookId, TwitterHandle, Education, Nationality, EmploymentandMaturityRating.