【问题标题】:How to change the text of message buttons of push notification in iOS?如何更改iOS中推送通知的消息按钮文本?
【发布时间】:2011-01-26 13:36:43
【问题描述】:

我正在使用 Apple 推送通知,当我收到新通知时,会出现一条带有两个按钮的消息:警告框显示:“查看”和“取消”。

我想将其转换为一键式警报。是否可以删除一个按钮并更改其余按钮的文本?

【问题讨论】:

    标签: iphone ios apple-push-notifications


    【解决方案1】:

    是的 - 请参阅“通知负载”here;将alert 设置为字典并将该字典中的action-loc-key 设置为null,您将获得一个按钮来关闭通知。

    【讨论】:

      【解决方案2】:

      是的,您可以 - 您需要将 alert 属性的 action-loc-key 子属性与您的 APS 有效负载一起发送。

      See this Apple Developer Article for full examples

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-02-01
        • 2020-12-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多