无效的参数:JSON必须包含“默认”或“ APNS_SANDBOX”的条目。 => Scala中的APNS错误(提升框架)

我正在获取APN无效参数:JSON必须包含“默认”或“ APNS_SANDBOX”的条目。日志在这里

无效的参数:JSON必须包含“默认”或“ APNS_SANDBOX”的条目。 => Scala中的APNS错误(提升框架)

代码块在这里:

无效的参数:JSON必须包含“默认”或“ APNS_SANDBOX”的条目。 => Scala中的APNS错误(提升框架)

该如何解决?这是内置在Scala lift框架中的。

youbaio 回答:无效的参数:JSON必须包含“默认”或“ APNS_SANDBOX”的条目。 => Scala中的APNS错误(提升框架)

这是javascript中的示例。同理,我们要使用。需要用例 1.APNS_沙盒 2.APNS 3.默认

  // Setup SNS Client
const snsClient = new SNS();
// whatever your full endpoint arn is. (from createPlatformEndpoint)
const endpointArn = 'arn:aws:sns:...';
// any extra data you want passed along with the message
const payload = {
  someCustomKey: 'someCustomValue'
};
// send it
snsClient.publish({
  TargetArn: endpointArn,MessageStructure: 'json',// so we can put in a custom payload and message
  Message: JSON.stringify({
    default: `DEFAULT MESSAGE ${message}`,APNS_SANDBOX: JSON.stringify({
      aps: {
        alert: `IOS Sandbox SPECIFIC MESSAGE ${message}`,},payload,}),APNS: JSON.stringify({
      aps: {
        alert: `IOS Prod SPECIFIC MESSAGE ${message}`,}).promise().then(() => {
   console.log('Notification sent!');
  }).catch((err) => {
   console.log('Failed to send with:',err);
  });

Used this link for reference

本文链接:https://www.f2er.com/2376993.html

大家都在问