Skip to content

Commit 1ad2967

Browse files
authored
feat(fcm): Add LiveActivityToken to ApnsConfig for iOS live activities support (#454)
* feat(fcm): Add LiveActivityToken to ApnsConfig for iOS live activities support * Empty commit message
1 parent 12a8d6b commit 1ad2967

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

FirebaseAdmin/FirebaseAdmin.Tests/Messaging/MessageTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ public void ApnsConfig()
10131013
AnalyticsLabel = "label",
10141014
ImageUrl = "https://example.com/image.png",
10151015
},
1016+
LiveActivityToken = "token",
10161017
},
10171018
};
10181019
var expected = new JObject()
@@ -1056,6 +1057,9 @@ public void ApnsConfig()
10561057
{ "image", "https://example.com/image.png" },
10571058
}
10581059
},
1060+
{
1061+
"live_activity_token", "token"
1062+
},
10591063
}
10601064
},
10611065
};

FirebaseAdmin/FirebaseAdmin/Messaging/ApnsConfig.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ public IDictionary<string, object> CustomData
7575
}
7676
}
7777

78+
/// <summary>
79+
/// Gets or sets the APNs token used for live activities on iOS. Refer
80+
/// to <a href="https://firebase.google.com/docs/cloud-messaging/ios/live-activity">
81+
/// Firebase live activity documentation</a> for more information.
82+
/// </summary>
83+
[JsonProperty("live_activity_token")]
84+
public string LiveActivityToken { get; set; }
85+
7886
/// <summary>
7987
/// Gets or sets the APNs payload as accepted by the FCM backend servers.
8088
/// </summary>
@@ -108,6 +116,7 @@ internal ApnsConfig CopyAndValidate()
108116
Headers = this.Headers?.Copy(),
109117
Payload = this.Payload.CopyAndValidate(),
110118
FcmOptions = this.FcmOptions?.CopyAndValidate(),
119+
LiveActivityToken = this.LiveActivityToken,
111120
};
112121
return copy;
113122
}

0 commit comments

Comments
 (0)