Display Engagement

Steps to activate and display a new GeoPush engagement

You can display engagements triggered by the GeoPush service. Just add the below code in you Activity in the GeoSDK.

If you're like us, itching to skip this guide and get your hands on the sample code, we have a sample project just for you. Feel free to clone on Github.

private Context mContext = null;
private Moments mMomentsClient;
protected void onCreate(Bundle savedInstanceState) {
//Do something of your insterest.
mContext = this;
private void initializeLotaDataSDK() {
mMomentsClient = MomentsClient.getInstance(this) {
protected void trackEngagements() {
//Receiver that handles notification. Provide the desired id, icon and ringtone for your notifications.
NotificationReceiver notificationReceiver = new NotificationReceiver(
101, R.drawable.lotadata_notification_icon, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) {
* Method called when user clicks on notification
* @param context The Context in which the receiver is running.
* @param actionText String representing the text specified during engagement creation.
* @param actionLink String representing the url link specified during engagement creation.
* @param actionLink String representing the notification message.
public void notificationClicked(Context context, String actionText, String actionLink, String message) {
!!! Notice that actionLink can be an URL or a class (depends on how the campaign was configured). !!!
!!! You should check the content before go ahead !!!
//For ilustration purporses.
if(actionLink.contains("http") || actionLink.contains("https")) {//Is it a url link?
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(actionLink));
browserIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
//Launch a browser
} else if (actionLink.contains(context.getPackageName())){//Is it an Activity class?
try {
Class activityClass = Class.forName(actionLink);
Intent myIntent = new Intent(context, activityClass);
myIntent.putExtra(Moments.LD_NOTIFICATION_ACTION_TEXT, actionText);
//Launch an internal activity
} catch (ClassNotFoundException e) {
protected void untrackEngagements() {
if(mMomentsClient != null) mMomentsClient.untrackEngagements();
protected void onDestroy() {
if (mMomentsClient != null) {


We are eager to hear from you and happy to share best practices for integrating the SDK. There are many ways for you to reach us:

But first, please sign up for an account and download our SDK.