Skip to content

Commit

Permalink
Firebase Cloud Messaging API (#81)
Browse files Browse the repository at this point in the history
* Adding Firebase Cloud Messaging (#62)

* initial commit for adding Firebase Cloud Messaging

* add validator

* use http const in messaging test

* add client version header for stats

* init integration test

* add integration test (validated on IOS today)

* add comment with URL to enable Firebase Cloud Messaging API

* fix broken test

* add integration tests

* accept a Message instead of RequestMessage + and rename method + send  / sendDryRun

* update fcm url

* rollback url endpoint

* fix http constants, change responseMessage visibility, change map[string]interface{} as map[string]string

* fix http constants

* fix integration tests

* fix APNS naming

* add validators

* Added APNS types; Updated tests

* Added more tests; Fixed APNS serialization

* Updated documentation

* Improved error handling inFCM

* Added utils file

* Updated integration tests

* Implemented topic management operations

* Added integration tests

* Updated CHANGELOG

* Addressing code review comments

* Supporting 0 valued Aps.Badge

* Addressing some review comments

* Removed some unused vars

* Accepting prefixed topic names (#84)

* Accepting prefixed topic named

* Added a comment

* Using new FCM error codes (#89)
  • Loading branch information
hiranya911 committed Jun 11, 2018
1 parent d388cd8 commit cf543ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@

### Authentication

- [added] A new [`VerifyIDTokenAndCheckRevoked()`](https://godoc.org/firebase.google.com/go/auth#Client.VerifyIDToken)
function has been added to check for revoked ID tokens.
- [added] A new [`RevokeRefreshTokens()`](https://godoc.org/firebase.google.com/go/auth#Client.RevokeRefreshTokens)
function has been added to invalidate all refresh tokens issued to a user.
- [added] A new property `TokensValidAfterMillis` has been added to the
['UserRecord'](https://godoc.org/firebase.google.com/go/auth#UserRecord)
type, which stores the time of the revocation truncated to 1 second accuracy.

### Cloud Messaging

- [feature] Added the `messaging` package for sending Firebase notifications
and managing topic subscriptions.

### Authentication

- [added] A new [`VerifyIDTokenAndCheckRevoked()`](https://godoc.org/firebase.google.com/go/auth#Client.VerifyIDToken)
function has been added to check for revoked ID tokens.
- [added] A new [`RevokeRefreshTokens()`](https://godoc.org/firebase.google.com/go/auth#Client.RevokeRefreshTokens)
Expand Down
7 changes: 7 additions & 0 deletions internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ type MockTokenSource struct {
AccessToken string
}

// MessagingConfig represents the configuration of Firebase Cloud Messaging service.
type MessagingConfig struct {
Opts []option.ClientOption
ProjectID string
Version string
}

// Token returns the test token associated with the TokenSource.
func (ts *MockTokenSource) Token() (*oauth2.Token, error) {
return &oauth2.Token{AccessToken: ts.AccessToken}, nil
Expand Down

0 comments on commit cf543ff

Please sign in to comment.