Initializing the Wunderkind Mobile SDK
Import the SDK
import co.wunderkind.sdk.Wunderkind
import WunderkindKit
import 'package:wunderkind_sdk/wunderkind.dart';
import { Wunderkind } from '@wunderkind-sdk-react/react-native-wunderkind-sdk'
Initialize the SDK
Initialize with your website_id
(if you don't know the value, please contact Wunderkind).
WSDK initialization is mandatory. Failure to do so will result in the WSDK events not being tracked.
In most cases, this should be done in:
- iOS:
application:didFinishLaunchingWithOptions
- Android:
MainActivity
Set isDebugMode
to true
first to allow you to verify events tracking functionality in a testing environment.
import co.wunderkind.sdk.Wunderkind
class MainActivity : AppCompatActivity() {
val wunderkind = Wunderkind.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
wunderkind.initialize(this, myWebsiteID, true)
}
}
import WunderkindKit
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey: Any]?)
→ Bool {
Wunderkind.shared.initialize(websiteId: 1234, isDebugMode: true)
}
}
Wunderkind().initialize(string WEBSITE_ID, bool isDebugMode);
Wunderkind.initializeSdk(int WEBSITE_ID, bool isDebugMode);
ImportantMake sure to set
isDebugMode
tofalse
before deploying to Production.