There are three action plug-ins you can use to enhance your mobile app message: Web Action, Snooze, and Add to Calendar.

The Mobile app messaging SDK provides the Web Action, Snooze, and Add-to-Calendar plug-ins that you can use to enhance your mobile app messages. You can use any of these by adding the set of files for each plug-in and registering them. Each plug-in requires specific parameters.

Add-to-Calendar plug-in

The Add to Calendar plug-in allows a user to add an event to the calendar.

The following parameters are for iOS.

{
	"interactive": true/false,	// true = brings up interface to add event
	"title": "<event title>", 	// text
	"timeZone": "<timezone>", 	//  text (optional)
	"startDate": "<the event start datetime>", 	// formatted like 2015-04-07T10:10:10Z
	"endDate": "<the event end datetime>", 	// formatted like 2015-04-07T10:10:10Z
	"description": "<event notes>", 	// text (saved to notes)
	"type": "calendar"  	// constant
}

The following parameters are for Android.

{
"interactive": true/false, // true = brings up interface to add event
"type": "calendar", // constant
"title": "<the event title>",
"description": "<the event description>",
"starts":   // the event start time
{
"date": "<the event start date>", // a string date in format "yyyy-MM-dd"
"time": "<the event start time>", // a string time in format "HH:mm"
"timezone": "<timezone>", // the timezone id, e.g: "GMT", "EST", etc.
}
"ends":   // the event end time
{
"date": "<the event end date>", // a string date in format "yyyy-MM-dd"
"time": "<the event end date>", // a string time in format "HH:mm"
"timezone": "<timezone>", // the timezone id, e.g: "GMT", "EST", etc.
}
}
}

If the time or timezone fields are incorrect, the timezone of the device is used. You can show the calendar user interface for adding an item to the calendar by adding interactive = true or false in the payload. If false, it does it in the background. Calendar requires AddToCalendarPlugin.h and AddToCalendarPlugin.m.

Note: The calendar action adds events to the calendar in the background without opening the calendar if the interactive flag is false.

To install the calendar plug-in, run the following command lines:

cordova plugin add <path to downloaded directory>/plugins/com.xtify.mce.sdk.calendar
cordova prepare

Snooze plug-in

The Snooze plug-in allows a mobile app user to bring back the mobile app message after some time.

The following parameters are for iOS.

{
"value": "<minutes to wait>", 
"type": "<snooze>"
}

The following parameters are for Android.

{
"time": "<minutes to wait>", 
"type": "<snooze>"
}

Tip: You should not have a single action as snooze.

To install the snooze plug-in, run the following command lines:

cordova plugin add <path to downloaded directory>/plugins/com.xtify.mce.sdk.snooze
cordova prepare

Web Action plug-in

The Web Action plug-in allows a mobile app user to view a web page inside the app.

The following parameters are for iOS.

{
	"value": "<url>",	// Url of web page to show (https only)
	"type": "displayWebView"	// Constant
}

The following parameters are for Android.

{
	"url": "<url>",	// Url of web page to show
	"type": "displayweb"	// Constant
}

To install the web action plug-in, run the following command lines:

cordova plugin add <path to downloaded directory>/plugins/com.xtify.mce.sdk.displayweb
cordova prepare

Go Back to the Mobile App Messaging home page.

Join The Discussion

Your email address will not be published. Required fields are marked *