Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) DeleteUserRT(uid string, id string) error
- func (c *Client) DetectInvalidToken(token string) error
- func (c *Client) GetAllUsers() ([]User, error)
- func (c *Client) GetUserRTs(uid string) (map[string]RegistrationToken, error)
- func (c *Client) SetUserRTDeprecated(uid string, id string, deprecated bool) error
- func (c *Client) SetUserRTRotated(uid string, id string, rotated bool) error
- type RegistrationToken
- type User
Constants ¶
const ( PathToRegistrationTokens = "/users/%s/fcmRegistrationTokens" // %s - user's id PathToRegistrationTokenDeprecated = "/users/%s/fcmRegistrationTokens/%s/deprecated" // %s - user's id, %s - number of token PathToRegistrationTokenRotated = "/users/%s/fcmRegistrationTokens/%s/rotated" // %s - user's id, %s - number of token PathToRegistrationToken = "/users/%s/fcmRegistrationTokens/%s" // %s - user's id, %s - number of token )
const ( // Firebase Cloud Messaging messages FCMTokenActive = "FCM registration token is active" FCMTokenUnregisteredError = "FCM registration token was unregistered" FCMTokenInvalidArgumentError = "FCM registration token is invalid" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeleteUserRT ¶
DeleteUserRT function deletes the Firebase Cloud Messaging Registration Token entry from the database.
func (*Client) DetectInvalidToken ¶
DetectInvalidToken function determines if a Firebase Cloud Messaging Registration Token is still valid by sending a message in dry run mode.
func (*Client) GetAllUsers ¶
func (*Client) GetUserRTs ¶
func (c *Client) GetUserRTs(uid string) (map[string]RegistrationToken, error)
GetUserRTs function returns a map which contains the Firebase Cloud Messaging Registration Tokens that belong to a user along with other metadata. The keys are UUIDs generated when the tokens are added to the database.
func (*Client) SetUserRTDeprecated ¶
SetUserRTDeprecated function sets the deprecated field of a user's Firebase Cloud Messaging Registration Token. By setting this to true, it marks the token for rotation which will be done by application on the user's smartphone.