开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜