Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS精确定位:设置APNS“;可变内容“1._Amazon Web Services_Apple Push Notifications_Aws Pinpoint - Fatal编程技术网

Amazon web services AWS精确定位:设置APNS“;可变内容“1.

Amazon web services AWS精确定位:设置APNS“;可变内容“1.,amazon-web-services,apple-push-notifications,aws-pinpoint,Amazon Web Services,Apple Push Notifications,Aws Pinpoint,AWS Poinpoint APNS默认设置“可变内容”:0 我正在使用Node.js 下面的操作很好,但是可变内容总是0“可变内容”:0: var messageRequest = { 'Addresses': { https://forums.aws.amazon.com/: { 'ChannelType': channelType } }, 'MessageConfiguration': { 'APNSMessage': { 'Action': action, 'Body': messag

AWS Poinpoint APNS默认设置
“可变内容”:0

我正在使用Node.js

下面的操作很好,但是可变内容总是
0
<代码>“可变内容”:0:

var messageRequest = {
'Addresses': {
https://forums.aws.amazon.com/: {
'ChannelType': channelType
}
},
'MessageConfiguration': {
'APNSMessage': {
'Action': action,
'Body': message,
'Priority': priority,
'SilentPush': silent,
'Title': title,
'TimeToLive': ttl,
'Url': url,
}
}
下面是使用上述设置发送APNS时获得的有效载荷

["aps": {
alert = {
body = "TEST";
title = "Test message sent from Amazon Pinpoint.";
};
"content-available" = 1;
"mutable-content" = 0;
}, "data": {
pinpoint = {
deeplink = "https://www.example.com";
};
}]

如何通过AWS Pinpoint为APNS设置
“可变内容”:1

没有文档,但经过一些尝试和错误后,这对我有效:

var payload = {
    "aps": {
        "alert": {
            "title": "Bold text in the notification",
            "body": "Second line in the notification"
        },
        "sound": "default",
        "mutable-content": 1
    }
};

var messageRequest = {
    Addresses: {
        [token]: {
            ChannelType: "APNS",
        },
    },
    MessageConfiguration: {
        APNSMessage: {
            RawContent: JSON.stringify(payload),
        },
    },
};
只需用RawContent替换他们的模板,并像平常一样创建有效负载。关于如何创建原始有效负载,可以参考apple文档。您还可以使用此方法调整内容可用键。以下是如何使用json创建有效负载的链接:


有相同的问题。你知道怎么做了吗?