Skip to content

Commit dd534ab

Browse files
Merge branch 'dev' into fcm-sendeach-worker-pool
2 parents d9f72ae + e66408c commit dd534ab

17 files changed

+2663
-11
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ jobs:
7676
startsWith(github.event.pull_request.title, '[chore] Release ')
7777

7878
runs-on: ubuntu-latest
79+
permissions:
80+
contents: write
7981

8082
steps:
8183
- name: Checkout source for publish

firebase.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"firebase.google.com/go/v4/iid"
3232
"firebase.google.com/go/v4/internal"
3333
"firebase.google.com/go/v4/messaging"
34+
"firebase.google.com/go/v4/remoteconfig"
3435
"firebase.google.com/go/v4/storage"
3536
"google.golang.org/api/option"
3637
"google.golang.org/api/transport"
@@ -39,7 +40,7 @@ import (
3940
var defaultAuthOverrides = make(map[string]interface{})
4041

4142
// Version of the Firebase Go Admin SDK.
42-
const Version = "4.15.2"
43+
const Version = "4.16.1"
4344

4445
// firebaseEnvName is the name of the environment variable with the Config.
4546
const firebaseEnvName = "FIREBASE_CONFIG"
@@ -138,6 +139,16 @@ func (a *App) AppCheck(ctx context.Context) (*appcheck.Client, error) {
138139
return appcheck.NewClient(ctx, conf)
139140
}
140141

142+
// RemoteConfig returns an instance of remoteconfig.Client.
143+
func (a *App) RemoteConfig(ctx context.Context) (*remoteconfig.Client, error) {
144+
conf := &internal.RemoteConfigClientConfig{
145+
ProjectID: a.projectID,
146+
Opts: a.opts,
147+
Version: Version,
148+
}
149+
return remoteconfig.NewClient(ctx, conf)
150+
}
151+
141152
// NewApp creates a new App from the provided config and client options.
142153
//
143154
// If the client options contain a valid credential (a service account file, a refresh token

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module firebase.google.com/go/v4
22

3-
go 1.24
4-
5-
toolchain go1.24.1
3+
go 1.23.0
64

75
require (
86
cloud.google.com/go/firestore v1.18.0
@@ -32,7 +30,7 @@ require (
3230
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
3331
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
3432
github.com/felixge/httpsnoop v1.0.4 // indirect
35-
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
33+
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
3634
github.com/go-logr/logr v1.4.2 // indirect
3735
github.com/go-logr/stdr v1.2.2 // indirect
3836
github.com/golang/protobuf v1.5.4 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfU
4848
github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU=
4949
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
5050
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
51-
github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0FdY=
52-
github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw=
51+
github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE=
52+
github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA=
5353
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
5454
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
5555
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=

internal/internal.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ type MessagingConfig struct {
7474
Version string
7575
}
7676

77+
// RemoteConfigClientConfig represents the configuration of Firebase Remote Config
78+
type RemoteConfigClientConfig struct {
79+
Opts []option.ClientOption
80+
ProjectID string
81+
Version string
82+
}
83+
7784
// AppCheckConfig represents the configuration of App Check service.
7885
type AppCheckConfig struct {
7986
ProjectID string

messaging/messaging.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,10 @@ type WebpushFCMOptions struct {
664664
// See https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html
665665
// for more details on supported headers and payload keys.
666666
type APNSConfig struct {
667-
Headers map[string]string `json:"headers,omitempty"`
668-
Payload *APNSPayload `json:"payload,omitempty"`
669-
FCMOptions *APNSFCMOptions `json:"fcm_options,omitempty"`
667+
Headers map[string]string `json:"headers,omitempty"`
668+
Payload *APNSPayload `json:"payload,omitempty"`
669+
FCMOptions *APNSFCMOptions `json:"fcm_options,omitempty"`
670+
LiveActivityToken string `json:"live_activity_token,omitempty"`
670671
}
671672

672673
// APNSPayload is the payload that can be included in an APNS message.

messaging/messaging_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,21 @@ var validMessages = []struct {
588588
"topic": "test-topic",
589589
},
590590
},
591+
{
592+
name: "APNSLiveActivity",
593+
req: &Message{
594+
Token: "test-token",
595+
APNS: &APNSConfig{
596+
LiveActivityToken: "live-activity-token",
597+
},
598+
},
599+
want: map[string]interface{}{
600+
"token": "test-token",
601+
"apns": map[string]interface{}{
602+
"live_activity_token": "live-activity-token",
603+
},
604+
},
605+
},
591606
{
592607
name: "AndroidNotificationPriorityMin",
593608
req: &Message{

0 commit comments

Comments
 (0)