Initialization (Android SDK - Kotlin)

Add the code to your app.

Don't forget to replace the %YOUR_STORE_KEY% text with the current store key from your PersonaClick account.


class SampleApplication: Application() {
	override fun onCreate() {
		super.onCreate()
		
		//Initialize
        val sdk = PersonaClick.getInstance()
        PersonaClick.initialize(applicationContext, "%YOUR_STORE_KEY%")
		
		//Notification callback
        sdk.setOnMessageListener(object : OnMessageListener {
            override fun onMessage(data: Map<String, String>) {

                //----->
                //Show your custom notification
                //----->

            }
        })
	}
}


For On-Premise integration need use initialize with custom api domain:

PersonaClick.initialize(applicationContext, "%YOUR_STORE_KEY%", "%API_DOMAIN%")


Check 
AndroidManifest.xml and add android:name=".SampleApplication" to application item.

<application
		...
		android:name=".SampleApplication"


Notification Data Structure:

{
	"title" : "Message title",
	"body" : "Message body",
	"icon" : "Message large url image",
	"url" : "Url for open and tracking events"
}

Copyright 2018-2024 PersonaClick