Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Add the code to your app.

Warning

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


Code Block
languagejava
themeFadeToGrey
public class SampleApplication extends: Application() {
	publicoverride voidfun onCreate() {
		super.onCreate();
		
		//Initialize
		
        val sdk = PersonaClick.getInstance()
        PersonaClick.initialize(getApplicationContext()applicationContext, "%YOUR_STORE_KEY%");
		
		//Notification callback
		PersonaClick        sdk.setOnMessageListener(newobject : MessagingService.OnMessageListener() {
			@Override
			public void
            override fun onMessage(data: Map<String, String> data) {
				
				

                //----->
				
                //Show your custom notification
				
                //----->
				
			}
		});
            }
        })
	}
}


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

Code Block
languagejava
themeFadeToGrey
PersonaClick.initialize(getApplicationContext()applicationContext, "%YOUR_STORE_KEY%", "%API_DOMAIN%");


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

Code Block
languagejava
themeFadeToGrey
<application
		...
		android:name=".SampleApplication"


Notification Data Structure:

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



Column

Related Pages

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
cqllabel = "initialization"