Versions Compared

Key

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

Initialize SDK object and use it anywhere in your applicationAdd the code to your app.

Warning

Remember to initialize SDK only once on application launch. Don't forget to replace the %YOUR_STORE_KEY% text with the current store key from your PersonaClick account.


Code Block
languageapplescript
themeFadeToGrey
import PersonaClick
...
var sdk = createPersonalizationSDK(shopId: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)
Or with completion to handle problems
 {
				
				//----->
				//Show your custom notification
				//----->
				
			}
		});
	}
}

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

Code Block
languageapplescript
themeFadeToGrey
import PersonaClick
...
var sdk = createPersonalizationSDK(shopId:.initialize(getApplicationContext(), "%YOUR_STORE_KEY%", { (error) in
    print(error)
})"%API_DOMAIN%");

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

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


Table of Contents
maxLevel2
classpersonaclick-fixed-position