End-to-end solution for building, managing and maintaining profitable mobile apps offering in-app purchases.
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website.
DeepWall is available through CocoaPods. To install it, add the following lines to your Podfile
.
use_frameworks!
pod 'DeepWall'
pod install
or pod update
.import DeepWall
to your project files.import DeepWall
let yourApiKey = "{YOUR_API_KEY}"
let environment: DeepWallEnvironment = .sandbox
DeepWall.initialize(apiKey: yourApiKey, environment: environment)
Replace {YOUR_API_KEY}
with your app token. You can find this key in your dashboard.
Depending on whether you build your app for testing or for production, you must set environment with one of these values:
let environment: DeepWallEnvironment = .sandbox
let environment: DeepWallEnvironment = .production
Important:
This value should be set to
.sandbox
only during testing your application. Make sure to set the environment to.production
just before you publish the app.
We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that you keep this value meaningful at all times!
DeepWall need to know following user properties for targeting.
String
DeepWallCountry
DeepWallCountryManager.getCountry(by: "TR") // TURKEY
DeepWallLanguage
DeepWallLanguageManager.getLanguage(by: "tr") // TURKISH
DeepWallEnvironmentStyle
automatic
: Uses system appearance (Default)light
: Light appearancedark
: Dark appearanceDeepWallAdvertiseAttributions
let attribution = ["debug_attribution: "debug_campaign_attribution"]
Important:
You must call
setUserProperties
method before requesting any paywall.let userProperties = DeepWallUserProperties(uuid: uuid, country: country, language: language, debugAdvertiseAttributions: debugAttributions)
DeepWall.shared.setUserProperties(userProperties)
#### Updating User Properties
You could update the following user properties with `DeepWall.shared.updateUserProperties()` method.
```swift
func updateUserProperties(country: DeepWallCountry? = nil,
language: DeepWallLanguage? = nil,
environmentStyle: DeepWallEnvironmentStyle? = nil,
debugAdvertiseAttributions: DeepWallAdvertiseAttributions = nil)
For pages to be displayed successfully, it is strongly recommended to wait for DeepWall.shared.readyStatus
before sending a page request.
You could use requestPaywall
method with action
parameter for showing paywalls.
// SomeUIViewController.swift
DeepWall.shared.requestPaywall(action: "{ACTION_KEY}", in: self)
Replace {ACTION_KEY}
with your related action key. You can find or create action keys in your dashboard.
You could also use extraData
parameter for sending extra data to paywalls.
// SomeUIViewController.swift
let deepwallExtraData: DeepWallExtraDataType = [
"some": "value"
]
DeepWall.shared.requestPaywall(action: "{ACTION_KEY}", in: self, extraData: deepwallExtraData)
You could use closePaywall
method to close paywalls.
DeepWall.shared.closePaywall()
You could use requestAppTracking
method with action
parameter for showing ATT prompts.
// SomeUIViewController.swift
DeepWall.shared.requestAppTracking(action: "{ACTION_KEY}", in: self)
Replace {ACTION_KEY}
with your related action key. You can find or create action keys in your dashboard.
DeepWall posts some various events depending on ....
deepWallPaywallRequested
deepWallPaywallResponseReceived
deepWallPaywallOpened
Paywall opened event
Parameters:
Int
deepWallPaywallNotOpened
Paywall not opened event. Fired on error cases only.
Parameters:
Int
deepWallPaywallActionShowDisabled
Paywall action show disabled event.
Int
deepWallPaywallClosed
Int
deepWallPaywallResponseFailure
String
String
deepWallPaywallPurchasingProduct
String
deepWallPaywallPurchaseSuccess
PloutosValidationType
PLPurchaseResponse
Array of SubscriptionItem
Array of ProductItem
deepWallPaywallPurchaseFailed
String
String
String
Bool
deepWallPaywallRestoreSuccess
deepWallPaywallRestoreFailed
RestoreFailedReason
String
String?
Bool
deepWallPaywallExtraDataReceived
deepWallATTStatusChanged
First implement DeepWallNotifierDelegate
protocol to your class. Then you could use observeEvents
method for observing events.
DeepWall.shared.observeEvents(for: self)
For removing observer, you could use removeObserver
method.
DeepWall.shared.removeObserver(for: self)