File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed 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 @@ -61,7 +61,7 @@ public async Task<ApnsResponse> SendAsync(
6161 string apnsId = null ,
6262 int apnsExpiration = 0 ,
6363 int apnsPriority = 10 ,
64- bool isBackground = false ,
64+ ApnPushType apnPushType = ApnPushType . Alert ,
6565 CancellationToken cancellationToken = default )
6666 {
6767 var path = $ "/3/device/{ deviceToken } ";
@@ -78,7 +78,7 @@ public async Task<ApnsResponse> SendAsync(
7878 message . Headers . Add ( "apns-topic" , settings . AppBundleIdentifier ) ;
7979 message . Headers . Add ( "apns-expiration" , apnsExpiration . ToString ( ) ) ;
8080 message . Headers . Add ( "apns-priority" , apnsPriority . ToString ( ) ) ;
81- message . Headers . Add ( "apns-push-type" , isBackground ? "background" : "alert" ) ; // required for iOS 13+
81+ message . Headers . Add ( "apns-push-type" , apnPushType . ToString ( ) . ToLowerInvariant ( ) ) ; // required for iOS 13+
8282
8383 if ( ! string . IsNullOrWhiteSpace ( apnsId ) )
8484 {
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