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 button 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