Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

iphone - 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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...