Initialize the SDK
2 min
to begin using the sdk, initialize it by creating the appstorys sdk in the app class you will need to replace the app id and account id with your credentials provided by the appstorys team the user id can be any random string that you use internally to define a user import com appversal appstorys appstorys class app application(){ override fun oncreate() { super oncreate() // initialize campaignmanager with userid and appid appstorys initialize( this, appid = "add your app id", // replace with app id accountid = "add your account id", // replace with account id userid = "add your user id",// replace with user id, any random string navigatetoscreen = { navigatetoscreen(it) }) } fun navigatetoscreen(name string) { // write your navigation logic here } } note if the user id is not present at the time of initialization, you can leave that and call the below whenever the user id gets generated appstorys setuserid("user id") to handle screen navigation the navigation system operates through a callback mechanism where 1\ you provide a navigation callback function during sdk initialization 2\ appstorys calls this callback when navigation is triggered by campaigns 3 your app handles the actual navigation logic using your preferred navigation framework you need to write the navigation logic inside the navigatetoscreen function 4\ you need to then pass the exact name of the screen where you need to navigate dynamically using the dashboard inside every campaign