Handling Custom In-App HTML
In order to use custom HTML option for In-app messages, you must implement the InAppCustomHTMLListener
and call smartech.setInAppCustomHTMLListener()
method in your application class.
public class MyApplication extends Application implements InAppCustomHTMLListener {
@Override
public void onCreate() {
super.onCreate();
Smartech smartech = Smartech.getInstance(new WeakReference<>(this));
smartech.initializeSdk(this);
smartech.setInAppCustomHTMLListener(this);
....
}
@Override
public void customHTMLCallback(@Nullable HashMap<String, Object> payload) {
// Handle In-App HTML callback.
}
}
class SampleApplication : Application(), InAppCustomHTMLListener {
override fun onCreate() {
super.onCreate()
val smartech: Smartech = Smartech.getInstance(WeakReference(this))
smartech.initializeSdk(this)
smartech.setInAppCustomHTMLListener(this)
...
}
override fun customHTMLCallback(payload: HashMap<String, Any>?) {
// Handle custom HTML callback.
}
}
Updated 6 months ago
Next
You can go back to setup other features or choose one of them from the left panel!