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) {
352
352
assert .NoError (t , err )
353
353
}
354
354
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
+
355
366
func TestAuthorizationHeader (t * testing.T ) {
356
367
n := mockNotification ()
357
368
token := mockToken ()
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ const (
71
71
// push type is recommended for iOS. It is not available on macOS, tvOS,
72
72
// watchOS and iPadOS.
73
73
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"
74
80
)
75
81
76
82
const (
You can’t perform that action at this time.
0 commit comments