未使用 Firebase 云消息传递调用 UNNotificationServiceExtension didReceive 方法

时间:2021-04-07 01:08:03

标签: swift firebase firebase-cloud-messaging apple-push-notifications

我一直在尝试使用通知服务扩展创建自定义 iOS 推送通知,但我一直无法在通知到达时调用 UNNotificationServiceExtension 中的 didReceive 方法。我觉得我已经尝试了 StackOverflow 上的所有建议,但仍然无法解决我的问题。下面是我发送到 Firebase 云消息传递的 json - 有人介意检查一下 json 中是否存在任何可能导致我的问题的格式问题吗?谢谢!

message = {
  apns: {
    headers: {
      'apns-push-type': 'alert'
    },
    payload: {
      aps: {
        category: 'TrendingPost',
        alert: {
          title: title,
          body: body,
        },
        mutable_content: true,
      },
      type: 'post',
      postID: postID,
      urlImageString: communityLogoURL,
    },
  },
  topic: communityID
};

0 个答案:

没有答案
相关问题