Configuring Action buttons

Action buttons are a great way to redirect users to the desired app screen via push notifications. In order to enable notifications with the action button you need to do the following configuration.

To support Action Button Notification you need to add a file, named SmartechConfig.plist to your project. Follow these steps to add the file in your project. Following is the sample of plist for action buttons or download the attachment from here.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ActionButtons_v2</key>
	<dict>
		<key>SmartechSimple_Actionable</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>text</string>
					<key>smtAction</key>
					<string>reply</string>
					<key>title</key>
					<string>Share Feedback</string>
					<key>option</key>
					<string>1</string>
					<key>placeholder</key>
					<string>Enter your feedback</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>copy</string>
					<key>title</key>
					<string>Copy Code</string>
					<key>option</key>
					<string>1</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>dismiss</string>
					<key>title</key>
					<string>Dismiss</string>
					<key>option</key>
					<string>3</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>snooze</string>
					<key>title</key>
					<string>Snooze</string>
					<key>option</key>
					<string>2</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>copy</string>
					<key>title</key>
					<string>Copy Code</string>
					<key>option</key>
					<string>4</string>
				</dict>
			</array>
		</dict>
		<key>SmartechSimple_Actionable_CopyCode</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>copy</string>
					<key>title</key>
					<string>Copy Code</string>
					<key>option</key>
					<string>1</string>
				</dict>
			</array>
		</dict>
		<key>SmartechSimple_Actionable_Snooze</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>snooze</string>
					<key>title</key>
					<string>Snooze</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
		<key>SmartechSimple_Actionable_Dismiss</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>dismiss</string>
					<key>title</key>
					<string>Dismiss</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
		<key>SmartechSimple_Actionable_Reply</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>text</string>
					<key>smtAction</key>
					<string>reply</string>
					<key>title</key>
					<string>Send</string>
					<key>option</key>
					<string>1</string>
					<key>placeholder</key>
					<string>Enter your feedback</string>
				</dict>
			</array>
		</dict>
		<key>SmartechSimple_Actionable_ReplyCopy</key>
		<dict>
			<key>smtType</key>
			<string>Simple</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>text</string>
					<key>smtAction</key>
					<string>reply</string>
					<key>title</key>
					<string>Send</string>
					<key>option</key>
					<string>1</string>
					<key>placeholder</key>
					<string>Enter your feedback</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>copy</string>
					<key>title</key>
					<string>Copy Code</string>
					<key>option</key>
					<string>1</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_YesNo</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>deeplink</string>
					<key>title</key>
					<string>Yes</string>
					<key>option</key>
					<string>4</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>deeplink</string>
					<key>title</key>
					<string>No</string>
					<key>option</key>
					<string>4</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_YesNoMaybe</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>deeplink</string>
					<key>title</key>
					<string>Yes</string>
					<key>option</key>
					<string>4</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>deeplink</string>
					<key>title</key>
					<string>No</string>
					<key>option</key>
					<string>4</string>
				</dict>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>deeplink</string>
					<key>title</key>
					<string>Maybe</string>
					<key>option</key>
					<string>2</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_Dismiss</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>dismiss</string>
					<key>title</key>
					<string>Dismiss</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_CopyCode</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>copy</string>
					<key>title</key>
					<string>Copy Code</string>
					<key>option</key>
					<string>4</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_Reply</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>text</string>
					<key>smtAction</key>
					<string>reply</string>
					<key>title</key>
					<string>Send</string>
					<key>option</key>
					<string>1</string>
					<key>placeholder</key>
					<string>Enter your feedback</string>
				</dict>
			</array>
		</dict>
		<key>SmartechImage_Actionable_Snooze</key>
		<dict>
			<key>smtType</key>
			<string>Image</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>snooze</string>
					<key>title</key>
					<string>Snooze</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
		<key>SmartechAudio_Actionable_Dismiss</key>
		<dict>
			<key>smtType</key>
			<string>Audio</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>dismiss</string>
					<key>title</key>
					<string>Dismiss</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
		<key>SmartechAudio_Actionable_Snooze</key>
		<dict>
			<key>smtType</key>
			<string>Audio</string>
			<key>actionItems</key>
			<array>
				<dict>
					<key>type</key>
					<string>button</string>
					<key>smtAction</key>
					<string>snooze</string>
					<key>title</key>
					<string>Snooze</string>
					<key>option</key>
					<string>3</string>
				</dict>
			</array>
		</dict>
	</dict>
</dict>
</plist>

Following is an image representation of SmartechConfig.plist.

1349

Explanation of keys used in the plist:

KeysUsage
ActionButtons_v2It is a dictionary which has all the categories used for action buttons with type and action button title.
smtTypeIt defines the type of notifications for which the button is to be attached. For example Simple, Image, Audio, Video, and Gif.
typeIt defines the type of Action button is to be attached. For example text, button.
smtActionIt defines the Action of the attached Action Button. For example reply, copy, dismiss, snooze, deeplink.
titleThe value of the action button title will be displayed on the action button in the notification.
optionIt defines the button title color and what it will perform.For details on option values and what it does please refer below table.
placeholderIt is the default placeholder text for Notification with Text input field. This is only in case when smtAction value is reply or type value is text.

Values and Usage of option key value

ValueColorUsage
1DefaultDismiss Notification when clicked.
2RedOpen app when clicked with Authentication.
3RedDismiss Notification when clicked.
4DefaultOpen App when clicked.

📘

Note:

The value of key smtType, type, smtAction in plist are case sensitive.
The name of the plist must be SmartechConfig.plist.

Upload SmartechConfig.plist to CEE Panel

After you have created the plist you need to upload the file on the panel. To upload plist file on the panel, refer the steps from PDF here