Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 1.56 KB

push.md

File metadata and controls

60 lines (39 loc) · 1.56 KB

Push : Customize push interactions

When the push module is started in our SDK, default events will be reported without you having to do anything. Our platform will trigger events such as : notification or webview.

This page indicates how to start the push component and how to customize the push events if you wish.

For a broader solution overview, click here

Requirements

  1. Successful SDK initialization and synchronization with [INSPush class] module added (see SDK Initialization).
  2. Auto-start or manually start (see SDK Start)

Customize push Events

The SDK provides you the possibility to custom the push event behavior. Your custom events will be treated like every other SDK events.

First, you have to implement your activity with ActionLauncher.Callbacks

...
	public class MainActivity extends Activity implements ActionLauncher.Callbacks {
}
...

Then, provide the Action Callback to PushManager

...
        Insiteo.getManager().getPushManager().setActionCallbacks(this);
...

Once finished, just implement the callbacks methods like this in your activity:

...

	@Override
    public void onActionNotification() {
		//Do what you want
    }

    @Override
    public void onActionCustom(String s) {
		//Do what you want
    }

    @Override
    public void onActionWebview(String s) {
        //Do what you want
    }
...