Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add buttons to push notification alert

Is there a way to set up how users see the push notifications alert box? My notifications are appearing without the view / cancel buttons, but i'm receiving others from different apps with those buttons. Is that a setting i should set before sending the push notification?

Thanks!

like image 563
albertosh Avatar asked Feb 25 '23 00:02

albertosh


1 Answers

There are two things going on in your question.

First, you will see no buttons at all when you receive Apple Push Notification alerts and your screen is locked. All Apps will have just the Title and the Message of the Alert, without the buttons. If your phone is unlocked, you will see the buttons.

Second, altering the Payload, you can customize the "View" button text (or remove it) Apple Push Documentation with the "action-loc-key" key. If you set it to null, only "OK" will be presented. If you specify a value, it must be a localized string in your Application and the "View" will be replaced with that value.

like image 185
Smith3 Avatar answered Mar 04 '23 01:03

Smith3