Teknasyon-Teknoloji / deepwall-ios-sdk

Managing apps that offer in-app purchases have never been easier with Deepwall
https://docs.deepwall.com/sdk-framework/sdk-installation/install-ios
MIT License
9 stars 3 forks source link
iap ios objective-c sdk store storekit swift xcode

DeepWall

Platform Cocoapods

End-to-end solution for building, managing and maintaining profitable mobile apps offering in-app purchases.

Installation

CocoaPods

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.

  1. Add DeepWall pod.
use_frameworks!

pod 'DeepWall'
  1. Run pod install or pod update.
  2. Then, you could use DeepWall by adding import DeepWall to your project files.

Usage

Initialization

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!

Configuration

DeepWall need to know following user properties for targeting.

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)

Requesting Paywall

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.

Sending Extra Data

You could also use extraDataparameter for sending extra data to paywalls.

// SomeUIViewController.swift

let deepwallExtraData: DeepWallExtraDataType = [
    "some": "value"
]
DeepWall.shared.requestPaywall(action: "{ACTION_KEY}", in: self, extraData: deepwallExtraData)

Closing Paywall

You could use closePaywall method to close paywalls.

DeepWall.shared.closePaywall()

Requesting ATT Prompts

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.

Event Handling

DeepWall posts some various events depending on ....

Usage Example

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)

Requirements

Migration Guides

Additional Features