Difference between revisions of "Admob Android Wrapper"

From POKKT DOCUMENTATION
Jump to: navigation, search
(Dependencies)
Line 5: Line 5:
 
-----
 
-----
  
Pokkt SDK version required: 7.6.1
+
Pokkt SDK version required: 8.0.0
  
 
AdMob SDK version used: 18.3.0
 
AdMob SDK version used: 18.3.0
Line 37: Line 37:
 
==== Dependencies ====
 
==== Dependencies ====
  
* Add PokktSDK_v7.6.1.aar or PokktSDK_v7.6.1.jar to your project.
+
* Add PokktSDK_v8.0.0.aar or PokktSDK_v8.0.0.jar to your project.
* Download AdMobWrapper, PokktCustomBanner, PokktCustomInterstitial, PokktCustomNative ,PokktCustomNativeMapper and PokktCustomRewardedVideo from Pokkt site and change package as per your project structure. OR Download our Wrapper jar and place in your project.
 
 
* Add AdMob consent library to your project.
 
* Add AdMob consent library to your project.
  
Line 55: Line 54:
 
<li>android.permission.ACCESS_NETWORK_STATE = Required to detect changes in network, like if WIFI is available or not.</li></ul>
 
<li>android.permission.ACCESS_NETWORK_STATE = Required to detect changes in network, like if WIFI is available or not.</li></ul>
 
</li>
 
</li>
<li><p>Optional permissions.<br /></p>
 
<pre><uses-permission android:name="android.permission.WAKE_LOCK" />
 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 
<uses-permission android:name="android.permission.CALL_PHONE" />
 
<uses-permission android:name="android.permission.SEND_SMS" />
 
<uses-permission android:name="android.permission.VIBRATE" /></pre>
 
<ul>
 
<li>android.permission.WAKE_LOCK = Required to prevent device from going into the sleep mode during video play.</li>
 
<li>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.</li>
 
<li>android.permission.WRITE_CALENDAR = Some Ads create events in calendar.</li>
 
<li>android.permission.ACCESS_COARSE_LOCATION" = Some Ads show content based on user’s location.</li>
 
<li>android.permission.ACCESS_FINE_LOCATION = Some Ads show content based on user’s location.</li>
 
<li>android.permission.CALL_PHONE = Some Ads are interactive and they provide you a way to call directly from the content.</li>
 
<li>android.permission.SEND_SMS = Some Ads are interactive and they provide you a way to send message.</li>
 
<li>android.permission.VIBRATE = Some Ads provide haptic feedback, so as to maintain their behaviour we need this permission</li></ul>
 
</li></ol>
 
  
 
'''Activity Declaration'''
 
'''Activity Declaration'''
Line 87: Line 67:
 
   android:windowSoftInputMode="stateAlwaysHidden|adjustUnspecified" /></pre>
 
   android:windowSoftInputMode="stateAlwaysHidden|adjustUnspecified" /></pre>
 
You can change the android screenOrientation landscape to portrait of your choice, the way you want to display the ads.
 
You can change the android screenOrientation landscape to portrait of your choice, the way you want to display the ads.
 
'''Service Declaration'''
 
 
Add the following service in your AndroidManifest for receiving InApp notifications.
 
 
<pre><service
 
  android:name="com.pokkt.sdk.notification.NotificationService"
 
  android:exported="false"
 
  android:label="PokktNotificationService"/></pre>
 
  
 
-----
 
-----

Revision as of 11:09, 2 June 2020

Pokkt Integration to AdMob

Last Update: 5th February, 2020


Pokkt SDK version required: 8.0.0

AdMob SDK version used: 18.3.0

AdMob consent library used: 1.0.7

Download Latest Version AdMob Wrapper.


Step 1: Getting Started

The following instructions assume you have already integrated Google Mobile Ads SDK into your application.


Step 2: Adding Your Application to Your Pokkt Publisher's Account

  • Create Account and log-in at https://www.pokkt.com
  • Add your application and get its application Id and Security key.

Step 3: Pokkt Integration

GDPR

Dependencies

  • Add PokktSDK_v8.0.0.aar or PokktSDK_v8.0.0.jar to your project.
  • Add AdMob consent library to your project.

Manifest

Permissions Declarations

Add the following permissions to your project manifest

  1. Mandatory permissions.

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    • 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.
  2. Activity Declaration

    Add the following activity in your AndroidManifest for Pokkt SDK integration.

    <activity
       android:name="com.pokkt.sdk.PokktAdActivity"
       android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode||screenSize|smallestScreenSize"
       android:hardwareAccelerated="true"
       android:label="Pokkt"
       android:screenOrientation="landscape"
       android:windowSoftInputMode="stateAlwaysHidden|adjustUnspecified" />

    You can change the android screenOrientation landscape to portrait of your choice, the way you want to display the ads.


    Step 4: Adding a Custom Event

    1. Sign in to your AdMob account at https://apps.admob.com.
    2. Under All apps on the left navigation, select the app you want to update.
    3. Click Mediation on the left navigation menu item.
    4. Select the mediation group to which POKKT should be added.

      Admob andr mediation.jpg

    5. Click New Ad Network.

      Admob andr adunit.jpg

    6. Click Add Custom event. Add Label for POKKT and ecpm value and then click continue.

      Admob andr addcustom.jpg

    7. Configure the ad units and provide the following details:
      • Class Name: Enter the name of the custom event class that you will implement in your app code.
        • For Rewarded Video: Enter your <package>.PokktCustomRewardedVideo
        • For Interstitial: Enter your <package>.PokktCustomInterstitial
        • For Banner: Enter your <package>.PokktCustomBanner

        If you are using our Wrapper jar, Custom event class name will be:

        • For Rewarded Video: com.pokkt.wrapper.thirdparty.AdMob.PokktCustomRewardedVideo
        • For Interstitial: com.pokkt.wrapper.thirdparty.AdMob.PokktCustomInterstitial
        • For Banner: com.pokkt.wrapper.thirdparty.AdMob.PokktCustomBanner
      • Label:Enter the name for the custom event. This is used in reporting and cannot be changed later.
      • Parameter(Mandatory):Enter a JSON string as follows:

        {
        "POKKT_SCREEN_NAME":"Screen Created on Pokkt Dashboard",
        "POKKT_APP_ID":"Pokkt App Id",
        "POKKT_SEC_KEY":"Pokkt App Security Key",
        "POKKT_THIRD_PARTY_USERID":"Unique user id as in your app",
        "POKKT_REWARD_NAME":"Virtual currency As per your App",
        "POKKT_DEBUG":true/false
        }
      Admob andr configure.jpg

    8. Click Done.

    Step 5: Testing your application

    Congratulation - that's it! You may now run your app and see Pokkt ads in action.

    Note - It will take around 6 hours time to reflect the changes made in the AdMob dashboard.