firebase / firebase-admin-go

Firebase Admin Go SDK
Apache License 2.0
1.13k stars 242 forks source link

FR: Start supporting ios 15's interruption-level #474

Closed AntonNguyen closed 2 years ago

AntonNguyen commented 2 years ago

Describe your environment

Describe the problem

With the release of iOS 15, they've added a new value to the payload:

A string that indicates the importance and delivery timing of a notification. The string values “passive”, “active”, “time-sensitive”, or “critical” correspond to the UNNotificationInterruptionLevel enumeration cases.

The FCM library at the moment doesn't support this key.

hiranya911 commented 2 years ago

You can always use the CustomData field to add parameters that are not explicitly defined on the type.

aps := &messaging.Aps{
  CustomData: map[string]interface{}{
    "interruption-level": "active",
  }
}

The SDK will serialize the json request correctly.

AntonNguyen commented 2 years ago

You can always use the CustomData field to add parameters that are not explicitly defined on the type.

aps := &messaging.Aps{
  CustomData: map[string]interface{}{
    "interruption-level": "active",
  }
}

The SDK will serialize the json request correctly.

@hiranya911 You're right. That works. Thanks!