File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,17 @@ func TestPushTypeLiveActivityHeader(t *testing.T) {
352352 assert .NoError (t , err )
353353}
354354
355+ func TestPushTypePushToTalkHeader (t * testing.T ) {
356+ n := mockNotification ()
357+ n .PushType = apns .PushTypePushToTalk
358+ server := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
359+ assert .Equal (t , "pushtotalk" , r .Header .Get ("apns-push-type" ))
360+ }))
361+ defer server .Close ()
362+ _ , err := mockClient (server .URL ).Push (n )
363+ assert .NoError (t , err )
364+ }
365+
355366func TestAuthorizationHeader (t * testing.T ) {
356367 n := mockNotification ()
357368 token := mockToken ()
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ const (
7171 // push type is recommended for iOS. It is not available on macOS, tvOS,
7272 // watchOS and iPadOS.
7373 PushTypeLiveActivity EPushType = "liveactivity"
74+
75+ // PushTypePushToTalk is used for notifications that provide information about the
76+ // push to talk. If you set this push type, the apns-topic header field
77+ // must use your app’s bundle ID with.voip-ptt appended to the end.
78+ // The pushtotalk push type isn’t available on watchOS, macOS, and tvOS. It’s recommended on iOS and iPadOS.
79+ PushTypePushToTalk EPushType = "pushtotalk"
7480)
7581
7682const (
You can’t perform that action at this time.
0 commit comments