Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



51 Commits

Repository files navigation

DeepWall Android SDK Usage


Deepwall works with minSdkVersion 21

In your Project gradle

allprojects {
   repositories {
       maven { url '' }
       maven { url '' }
implementation 'deepwall:deepwall-core:2.6.6'

Google Implementation

If you use Deepwall SDK with Google services you should add google implementation too

implementation 'deepwall:deepwall-google:2.6.6'

Huawei Implementation

If you use Deepwall SDK with Huawei services you should add huawei implementation too

implementation 'deepwall:deepwall-huawei:2.6.6'


The DeepWall library is started within the onCreate method of your application's launch activity class.

For Google

   platform = Platform.GOOGLE,
   activity = activity,
   apiKey = "DEEPWALL_API_KEY",
   environment = DeepWallEnvironment.PRODUCTION,

For Huawei

   platform = Platform.HUAWEI,
   activity = activity,
   apiKey = "DEEPWALL_API_KEY",
   environment = DeepWallEnvironment.PRODUCTION,
platform Platform refers for GOOGLE or HUAWEI
activity Starting activity instance
apiKey DeepWall Api Key
environment DeepWall environment. You should use SANDBOX for test, PRODUCTION for prod


DeepWall needs to know the following user properties for targeting.

deviceId: String Unique identifier for specifying user profile or device.
Country : String Two-letter country code; Usage: DeepWallCountry.TURKEY // TURKEY
Language: String Two-letter language code; Usage: DeepWallLanguage.TURKISH // TURKISH
phoneNumber: String (Optional)
email: String (Optional)
firstName: String(Optional)
lastName: String(Optional)
Environment Style: DeepWallEnvironmentStyle Environment style for Paywall page appearance. Values: AUTOMATIC: Uses system appearance (Default) , LIGHT: Light appearance, DARK: Dark appearance


You must call Properties method before requesting any Paywall page.

    deviceId = androidId, 
    languageCode = DeepWallLanguage.getLanguageCodeByName(DeepWallLanguage.ENGLISH_UNITED_STATES), 
    countryCode = DeepWallCountry.getCountryCodeByName(DeepWallCountry.UNITED_STATES_OF_AMERICA),
    environmentStyle = DeepWallEnvironmentStyle.DARK 

Updating User Properties

You could update the following user properties with DeepWall.updateUserProperties method.

Country : String Two-letter country code; Usage: "TR" // TURKEY
Language: String Two-letter language code; Usage: "tr-tr" // TURKISH
Environment Style: DeepWallEnvironmentStyle Environment style for paywall page appearance. Values: AUTOMATIC: Uses system appearance (Default) , LIGHT: Light appearance, DARK: Dark appearance
phoneNumber: String (Optional)
email: String (Optional)
firstName: String (Optional)
lastName: String (Optional)
   languageCode = "tr-tr", 
   countryCode = "TR"
   environmentStyle = DeepWallEnvironmentStyle.DARK  

Requesting Paywall Page

  activity = this,
  action =ACTION_KEY”,
  orientation = PaywallOrientation.PORTRAIT
activity Instance of the activity where the showPaywall method is called
action Action to be used for page display it is String value
orientation Orientation of the paywall (default Portrait)

Sending Extra Data

You could also use extraData parameter for sending extra data to paywall pages via Bundle.

For example Example model

val extraDataBundle = Bundle()
   activity = this,
   action =ACTION”,
   extraData = bundle,
   orientation = PaywallOrientation.PORTRAIT

Closing Paywall Page

You could use closePaywall method to close Paywall pages.


Custom Font Usage

If you want to use your app fonts in Paywalls You must have font directory in your res directory (android/res/font). After that you can use app fonts with DeepWall.

For the best performance you must call font function immediately after DeepWall initialization

   val fontFields =

Consume Products

You can use consumeProduct method to consume your products.

DeepWall.consumeProduct(productId : String)

Subscription Upgrade/Downgrade

If you want to subscription upgrade or downgrade processes in your app you can use setProductUpgradePolicy method for general use

  prorationType = ProrationType.IMMEDIATE_WITHOUT_PRORATION,
  upgradePolicy = PurchaseUpgradePolicy.ENABLE_ALL_POLICIES

If you have different policies for your products you can use updateProductUpgradePolicy method for your paywalls.

    prorationType = ProrationType.IMMEDIATE_WITHOUT_PRORATION,
    upgradePolicy = PurchaseUpgradePolicy.ENABLE_ALL_POLICIES)

For the detailed information about ProrationTypes you can see this document

ENABLE_ALL_POLICIES All policies are open. Users can upgrade or downgrade their products
DISABLE_ALL_POLICIES All policies are closed. Users can not upgrade or downgrade their products
ENABLE_ONLY_UPGRADE Users can only upgrade their products
ENABLE_ONLY_DOWNGRADE Users can only downgrade their products

Event Handling

DeepWall posts some various events depending on ....

  • PAYWALL_OPENED Paywall opened event data as PaywallOpenedInfo Parameters : pageId: Int testInfo: PaywallTestInfo

  • CLOSED Paywall closed event data as PaywallClosedInfo Parameters : pageId: Int testInfo: PaywallTestInfo

  • PAYWALL_RESPONSE_FAILURE PAYWALL response failure event data as PaywallFailureResponse Parameters: errorCode: String reason: String testInfo: PaywallTestInfo

  • DO_NOT_SHOW Paywall action show disabled event data as PaywallActionShowDisabledInfo Parameters: pageId : Int

  • PAYWALL_PURCHASING_PRODUCT Paywall purchasing product event data as PaywallPurchasingProductInfo Parameters: productCode: String testInfo: PaywallTestInfo

  • PAYWALL_PURCHASE_SUCCESS Purchase success event. Fired after receipt validation if Ploutos service active.

val subscriptionResponse = as SubscriptionResponse

Parameters: type : DeepWallReceiptValidationType result : SubscriptionDetail -subscriptions : Array of PurchaseSubscriptionItem -products : Array of String

  • PAYWALL_PURCHASE_FAILED Purchase failed event
val data = as SubscriptionErrorResponse

Parameters: type : DeepWallReceiptValidationType result : String

  • EXTRA_DATA Extra data received event Parameters:Any

  • PAYWALL_REQUESTED Fired after paywall requested. Useful for displaying loading indicator in your app.

  • PAYWALL_RESPONSE_RECEIVED Fired after paywall response received. Useful for hiding loading indicator in your app.

  • PAYWALL_NOT_OPENED Fired if your product list is empty.

  • CONSUME_SUCCESS Fired after consume product request success

  • CONSUME_FAILURE Fired after consume product request failure

Test Info

Some events provides info about related test. To check test info snipped below can be used. Which events provides event info is listed in event list.

val eventData =
if(eventData is TestEvent){

Usage Example

EventBus.subscribe(Consumer { 
   DeepWallEvent.EXTRA_DATA.value -> { 
   Toast.makeText(this,, Toast.LENGTH_SHORT).show() } 

DeepWallEvent.CLOSED.value ->  {
val data = as PaywallClosedInfo
Toast.makeText(this@MainActivity, "PAYWALL_CLOSED : ${data.pageId}", Toast.LENGTH_LONG).show() }

val subscriptionResponse = as SubscriptionResponse
subscriptionResponse.result.subscriptionList.forEach { subItem->
   if(subItem.isActive == 1){
       //Do something

DeepWallEvent.PAYWALL_OPENED.value -> { 
val data = as PaywallOpenedInfo
Toast.makeText(this@MainActivity, "PAYWALL OPENED : ${key.pageId}", Toast.LENGTH_LONG).show() } 

Changing ExoPlayer Version

DeepWall is shipped with ExoPlayer 2.18.1. If other versions of ExoPlayer required, deepwall-video package should be excluded and compatible version of deepwall-video should be added.

    exclude group: 'deepwall', module: 'deepwall-video'

DeepWall Video package versions and corresponding ExoPlayer versions are listed below

DeepWall Video ExoPlayer 2.13.2 2.14.2 2.15.1 2.16.1 2.17.1 2.18.1