【问题标题】:Xamarin IOS Push Killed appXamarin IOS Push Killed 应用程序
【发布时间】:2019-01-01 23:28:48
【问题描述】:

推=>

{{
aps =     {
    alert =         {
        "loc-args" =             (
        );
        "loc-key" = "new_chat";
    };
    "content-available" = 1;
    id = 3;
    message = Aaa;
    sound = default;
    subject = "new_chat";
    type = chat;
};

}}

当应用程序被终止并且我收到推送通知时,它会显示文本“new_chat”。如何将其更改为其他文本?

【问题讨论】:

    标签: ios xamarin xamarin.forms xamarin.ios


    【解决方案1】:

    假设您的目标是 iOS 10+,您可以将 Notification Services 扩展应用 (UNNotificationServiceExtension) 添加到您的 app bundle。

    在发送给用户之前修改远程通知的内容。

    DidReceiveNotificationRequest 覆盖中,从UNNotificationRequest 中提取您的内容并对其进行修改并通过提供的contentHandler 返回。

    了解如何/何时使用扩展的必读:

    还有:

    Xamarin 文档:iOS Extensions in Xamarin.iOS

    苹果文档:UNNotificationServiceExtension

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-03
      相关资源
      最近更新 更多