@rokt/cordova-plugin-roktsdk
v4.7.3
Published
The Rokt Cordova SDK enables you to integrate Rokt into your mobile apps to drive more value from—and for—your customers.
Maintainers
Readme
Rokt Cordova SDK Architecture
The Rokt Cordova SDK is built as a standard Cordova plugin that bridges JavaScript calls in Cordova apps to native implementations on Android and iOS platforms. The plugin allows Cordova app developers to integrate with Rokt's placement and conversion tracking functionality.
Directory Structure
Rokt.Widget/
├── www/ # JavaScript interface
│ └── roktSDK.js # Main JavaScript entry point
├── src/
│ ├── android/ # Android native implementation
│ │ ├── RoktSDK.java # Main Android plugin class
│ │ └── ... # Supporting files
│ └── ios/ # iOS native implementation
│ ├── RoktSdk.m # Main iOS plugin class (or .m)
│ └── ... # Supporting files
└── plugin.xml # Plugin definition and configurationComponent Overview
JavaScript Interface Layer (
Rokt.Widget/wwwdirectory):rokt.js: The main entry point exposing theRoktSDKglobal interface- Defines the public API methods (
initialize,execute) consumed by Cordova applications - Handles parameter validation and messaging between JavaScript and native code
Native Implementations:
- Android (
Rokt.Widget/src/android):- Uses the Java Android SDK for Rokt
RoktSdk.java: Main entry point for Android implementation- Converts JavaScript calls into native Android SDK calls
- iOS (
Rokt.Widget/src/ios):- Uses the Swift/Objective-C iOS SDK for Rokt
RoktSdk.swift/m: Main entry point for iOS implementation- Bridges JavaScript calls to native iOS SDK methods
- Android (
Configuration Files:
plugin.xml: Defines how the plugin is structured and integrated- Platform-specific build configurations
