File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ private static async Task SendFcmNotificationAsync()
7272 notification = new { body = "Hello World!" }
7373 } ;
7474
75- var response = await fcm . SendAsync ( fcmReceiverToken , payload ) ;
75+ var response = await fcm . SendAsync ( payload ) ;
7676 }
7777 }
7878}
Original file line number Diff line number Diff line change 1+ namespace CorePush . Apple
2+ {
3+ public enum ApnPushType
4+ {
5+ Background ,
6+ Alert ,
7+ Voip
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public async Task<ApnsResponse> SendAsync(
7070 string apnsId = null ,
7171 int apnsExpiration = 0 ,
7272 int apnsPriority = 10 ,
73- bool isBackground = false ,
73+ ApnPushType apnPushType = ApnPushType . Alert ,
7474 CancellationToken cancellationToken = default )
7575 {
7676 var path = $ "/3/device/{ deviceToken } ";
@@ -87,7 +87,7 @@ public async Task<ApnsResponse> SendAsync(
8787 message . Headers . Add ( "apns-topic" , settings . AppBundleIdentifier ) ;
8888 message . Headers . Add ( "apns-expiration" , apnsExpiration . ToString ( ) ) ;
8989 message . Headers . Add ( "apns-priority" , apnsPriority . ToString ( ) ) ;
90- message . Headers . Add ( "apns-push-type" , isBackground ? "background" : "alert" ) ; // required for iOS 13+
90+ message . Headers . Add ( "apns-push-type" , apnPushType . ToString ( ) . ToLowerInvariant ( ) ) ; // required for iOS 13+
9191
9292 if ( ! string . IsNullOrWhiteSpace ( apnsId ) )
9393 {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Task<ApnsResponse> SendAsync(
1212 string apnsId = null ,
1313 int apnsExpiration = 0 ,
1414 int apnsPriority = 10 ,
15- bool isBackground = false ,
15+ ApnPushType apnPushType = ApnPushType . Alert ,
1616 CancellationToken cancellationToken = default ) ;
1717 }
1818}
You can’t perform that action at this time.
0 commit comments