Overview
In the Send Experience, JSON code sent to Xtify must be modified to a format that SDK understands.
For example: To support [“email1@yahoo.com”, “email2@gmail.com”] for value, make sure that inputRequired = false
dataType = JSON
{
“id”: “recipients”,
“inputRequired”: “true”,
“type”: “object”,
“placeholder”: “”,
“value”: [“test1@email.com”,”test2@email.com”]
}
The Send to Xtify payload would look like:
recipients: [‘test1@email.com’,’test2@email.com’]
Custom Action JSON for iOS
{
“label”: “View”,
“type”: “viewProduct”,
“platform”: “iOS”,
“description”: “Opens the product detail page for the product specified for this push”,
“destructive”: “false”,
“authentication”: “false”,
“foreground”: “true”,
“customProperties”: [
{
“id”: “product”,
“inputRequired”: true,
“type”: “string”,
“placeholder”: “Enter the product ID”,
“value”: “MyProduct”
},
{
“id”: “language”,
“inputRequired”: true,
“type”: “string”,
“placeholder”: “Enter the preferred language”,
“value”: “English”
}
]}
Send to Xtify payload
In the send to Xtify payload it looks like:
type: “ViewProduct”, name: “View”, product:”MyProduct”, language:”English” – remove “value” for custom actions if we can. If we cannot we should pass an empty string.
Custom Action JSON for Android:
{
“label”: “View”,
“type”: “com.macys.intent.openApp”,
“platform”: “Android”,
“description”: “Opens the product detail page for the product specified for this push”,
“customProperties”: [
{
“id”: “likesPizza”,
“inputRequired”: true,
“type”: “boolean”,
“placeholder”: “”,
“value”: true
},
{
“id”: “greeting”,
“inputRequired”: true,
“type”: “string”,
“placeholder”: “”,
“value”: “hello world”
},
{
“id”: “productId”,
“inputRequired”: true,
“type”: “number”,
“placeholder”: “product id”,
“value”: 1234
},
{
“id”: “recipients”,
“inputRequired”: false,
“type”: “object”,
“placeholder”: “”,
“value”: {
“emails”: [
{
“address”: “test1@email.com”
},
{
“address”: “test2@email.com”
}
]}
}
]}
Payload to Xtify
iOS simple
{
“aps”: {
“alert”: “Bob wants to play poker”,
“badge”: 5
},
“notification-action”: {
“name”: “View”,
“type”: “com.macys.intent.openApp”,
“value”: {
“likesPizza”: true,
“greeting”: “hello world”,
“productId”: 1234,
“recipient”: {
“emails”: [
{
“address”: “test1@email.com”
},
{
“address”: “test2@email.com”
}
]}
}
}
}
iOS multiple actions
{“aps”: {
“content-available”: 1
},
“dynamic-aps”: {
“alert”: “Bob wants to play poker”,
“badge”: 5
},
“notification-action”: {
“type”: “url”,
“value”: “http://www.macys.com”
},
“category-actions”: [
{
“name”: “name”,
“type”: “sendEmailCustomType”,
“value”: {
“likesPizza”: true,
“greeting”: “hello world”,
“productId”: 1234,
},
“destructive”: “destructive”,
“authentication”: “authentication”,
“foreground”: “foreground”
},
{
“name”: “name”,
“type”: “myCustomType”,
“value”: {
“likesPizza”: true,
“greeting”: “hello world”,
“productId”: 1234,
“recipient”: {
“emails”: [
{
“address”: “test1@email.com”
},
{
“address”: “test2@email.com”
}
]}
},
“destructive”: “destructive”,
“authentication”: “authentication”,
“foreground”: “foreground”
}
]}