开发者

How to change the text of message buttons of push notification in iOS?

开发者 https://www.devze.com 2023-02-06 16:21 出处:网络
I am using Apple Push Notifications and when I receive a new notification, a message with two buttons appears: the alert box says: \"View\" and \"Cancel\".

I am using Apple Push Notifications and when I receive a new notification, a message with two buttons appears: the alert box says: "View" and "Cancel".

I want to convert it into a one button alert. Is it possible to remove one bu开发者_JAVA百科tton and change the text of the remaining one?


Yes - see "The Notification Payload" here; set alert to a dictionary and action-loc-key in that dictionary to null and you'll get a single button that dismisses the notification.


Yes you can - you need to send the action-loc-key child property of the alert property with your APS payload.

See this Apple Developer Article for full examples

0

精彩评论

暂无评论...
验证码 换一张
取 消