Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/com/google/firebase/messaging/ApnsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/
public class ApnsConfig {

@Key("live_activity_token")
private final String liveActivityToken;

@Key("headers")
private final Map<String, String> headers;

Expand All @@ -45,6 +48,7 @@ private ApnsConfig(Builder builder) {
checkArgument(builder.aps != null, "aps must be specified");
checkArgument(!builder.customData.containsKey("aps"),
"aps cannot be specified as part of custom data");
this.liveActivityToken = builder.liveActivityToken;
this.headers = builder.headers.isEmpty() ? null : ImmutableMap.copyOf(builder.headers);
this.payload = ImmutableMap.<String, Object>builder()
.putAll(builder.customData)
Expand All @@ -64,13 +68,22 @@ public static Builder builder() {

public static class Builder {

private final String liveActivityToken;
private final Map<String, String> headers = new HashMap<>();
private final Map<String, Object> customData = new HashMap<>();
private Aps aps;
private ApnsFcmOptions fcmOptions;

private Builder() {}

/**
* Sets the liveActivityToken.
*/
public Builder set(String liveActivityToken) {
this.liveActivityToken = liveActivityToken;
return this;
}

/**
* Adds the given key-value pair as an APNS header.
*
Expand Down