Getting Started
Get started with ContextSDK — sign up, create a license key, and integrate the SDK with step-by-step setup guides for all platforms.
Sign Up and Create a License Key
SDK Integration
dependencies: [
.package(url: "https://github.com/context-sdk/context-sdk-releases", .upToNextMajor(from: "5.14.1")),
]pod "ContextSDK"import ContextSDK
class AppDelegate: NSObject, UIApplicationDelegate {
// …
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// …
ContextManager.applicationDidFinishLaunchingWithOptions(launchOptions, licenseKey: "YOUR_LICENSE_KEY")
// …
}
}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
}
}struct YourApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
// …
}dependencyResolutionManagement {
repositories {
// …
// Add the ContextSDK Maven repo:
maven {
url = uri("https://storage.googleapis.com/fc4073e9-contextsdk-maven/")
}
}
}dependencies {
// …
implementation("com.contextsdk:contextsdk:1.0.0")
}dependencyResolutionManagement {
repositories {
// …
// Add the ContextSDK maven repo:
maven {
url 'https://storage.googleapis.com/fc4073e9-contextsdk-maven/'
}
}
}dependencies {
// …
implementation 'com.contextsdk:contextsdk:1.0.0'
}class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
ContextSDK.setup(this, "YOUR_LICENSE_KEY")
}
}class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ContextSDK.attachToActivity(this)
}
override fun onDestroy() {
super.onDestroy()
ContextSDK.detachFromActivity(this)
}
}public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ContextSDK.Companion.setup(this, "YOUR_LICENSE_KEY", new ContextSDKConfiguration());
}
}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);
}
}ContextDecision
ContextPush
Last updated
Was this helpful?