Skip to content

ContextPush

This page explains how to use ContextSDK to increase the open-rate of your mobile push notifications.

Overview

  • Step 1: Add ContextSDK to your app
  • Step 2: Ship app into production in Calibration Mode
  • Step 3: Once the model is ready, you'll get a message and can choose the Over-The-Air rollout

How does it work?

  • Your existing push notification provider / engagement platform sends a web request to our servers, and we will take care of the delivery
  • We leverage background push notifications to periodically wake up your app for just a few seconds
  • During calibration phase, we will send the notifications at random times within the time frame you provided, to learn in which contexts your users are most likely to open the app
  • Once your custom model is ready, we deploy the machine learning model to your app
  • From that moment on, your notifications will be shown at the optimal time for the highest open-rate
  • You have control over the time span in which the notification is shown (e.g. best moment within 12 hours)
  • Use ContextPush for non-time-sensitive notifications, such as news, promotions, or reminders
  • You will keep using your existing push notification provider for time-sensitive notifications, such as chat messages or time-bound promotions, and only offload the non-time-sensitive notifications (e.g. re-engagement campaigns, news, promotions) to ContextPush

Impact on your app

Less than 0.2% CPU Usage

0.6 MB Memory Usage

Adds less than 700kb to your app's binary size

No PII processed or stored

No app permissions required

Operates without ATT

Installation

Register here to get your license key, then add the SDK to your app:

Add https://github.com/context-sdk/context-sdk-releases as dependency.

Add the following dependency to your Podfile and run pod install

pod 'ContextSDK'

  1. Download the latest release: https://storage.googleapis.com/de73e410-context-sdk-releases/latest/ContextSDK.zip
  2. Drag & Drop the ContextSDK.xcframework folder into the Xcode file list
  3. Go to your project settings, scroll down to Frameworks, Libraries, and Embedded Content, add ContextSDK.xcframework, and select Embed & Sign

If you want to download a specific version, you can replace latest with the desired version number, e.g. https://storage.googleapis.com/de73e410-context-sdk-releases/3.1.0/ContextSDK.zip

License Key

After you installed ContextSDK, you need to add your license key. Register here to get started.

In your willFinishLaunchingWithOptions: (or anywhere before you access the SDK) setup the ContextManager:

AppDelegate.swift
import ContextSDK
AppDelegate.swift willFinishLaunchingWithOptions:
ContextManager.applicationDidFinishLaunchingWithOptions(launchOptions, licenseKey: "YOUR_LICENSE_KEY")
  1. Create a new custom Swift class named AppDelegate.swift
    AppDelegate.swift
    import ContextSDK
    
    class AppDelegate: NSObject, UIApplicationDelegate {
        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
            ContextManager.applicationDidFinishLaunchingWithOptions(launchOptions, licenseKey: "YOUR_LICENSE_KEY")
            return true
        }
    }
    
  2. In your App scene UIApplicationDelegateAdaptor property wrapper
    struct YourApp: App {
        @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
        // ...
    }
    

Note: Android is still in beta - to obtain a license key contact us at support@contextsdk.com

  1. In your Application sub-class call the following code:
class MainApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        ContextSDK.setup(this, "YOUR_LICENSE_KEY_HERE")
    }
}
  1. In your primary Activity subclass, or in every Activity in your application, allow ContextSDK to attach and detach:
class MainActivity : AppCompatActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    ContextSDK.attachToActivity(this)
  }

  override fun onDestroy() {
    super.onDestroy()
    ContextSDK.detachFromActivity(this)
  }
}
  1. In your Application sub-class call the following code:
public class MainApplication extends Application {

  @Override
  public void onCreate() {
    super.onCreate();
    ContextSDK.Companion.setup(this, "YOUR_LICENSE_KEY_HERE", new ContextSDKConfiguration());
  }
}
  1. In your primary Activity subclass, or in every Activity in your application, allow ContextSDK to attach and detach:
public class MainActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ContextSDK.Companion.attachToActivity(this);
  }

  @Override
  protected void onDestroy() {
    super.onDestroy();
    ContextSDK.Companion.detachFromActivity(this);
  }
}

Notes:

  • If the above isn't setup correctly, ContextSDK won't be able to start and stop collection of accelerometer & gyroscope data.
  • The Activity must conform to LifecycleOwner (e.g. AppCompatActivity). Plain Activities are not supported.

Call the following code on app start:

import { setup } from 'react-native-context-sdk';

void setup("YOUR_LICENSE_KEY_HERE");

In the Start() of a MonoBehaviour that is run early in your game (or anywhere before you access the SDK) setup the ContextManager:

InitContextSDK.cs
using static ContextSDKBinding;

public class InitContextSDK : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        ContextSDKBinding.SetupWithAPIBackend("YOUR_LICENSE_KEY");
    }
}

Call the following code on app start:

import 'package:context_sdk/context_sdk.dart';

final _contextSdkPlugin = ContextSdk();

_contextSdkPlugin.setup("YOUR_LICENSE_KEY_HERE");