Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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.


public class SampleApplication extends Application {
	public void onCreate() {
		super.onCreate();
		
		//Initialize
		PersonaClick.initialize(getApplicationContext(), "%YOUR_STORE_KEY%");
		
		//Notification callback
		PersonaClick.setOnMessageListener(new MessagingService.OnMessageListener() {
			@Override
			public void onMessage(Map<String, String> data) {
				
				//----->
				//Show your custom notification
				//----->
				
			}
		});
	}
}

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

PersonaClick.initialize(getApplicationContext(), "%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"
}

  • No labels