Add buttons to push notification alert

2019-01-20 01:03发布

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!

2条回答
做自己的国王
2楼-- · 2019-01-20 01:16

Check out the docs -- as you can send the name of the "open app" button in the push notification payload. Here's apples take on it

查看更多
男人必须洒脱
3楼-- · 2019-01-20 01:22

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.

查看更多
登录 后发表回答