fcm

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2019 License: MIT Imports: 5 Imported by: 0

README

go-fcm

How to use

to use this package you need get your private key from firebase

GET YOUR PRIVATE KEY HERE

Dont forget set environment variable GOOGLE_APPLICATION_CREDENTIALS to location private key in your app example -> os.Getenv("/app/generated-private-key.json")

to be continue...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendMessageOne

func SendMessageOne(msg *Message) (string, error)

SendMessageOne send message to one token/device return

func ValidateToken

func ValidateToken(msg *Message) (string, error)

ValidateToken validate valid token if not return an error

Types

type Message

type Message struct {
	Token string
	Title string
	Body  string
	Topic string
	Data  map[string]string

	// Apple / iOS
	Subtitle  string
	ActioniOS string

	// Android
	ActionAndroid string

	// Webpush
	ActionWebPush  string
	CustomData     map[string]interface{}
	BadgeIconImage string
	SoundWebPush   string
	TagsCategory   string
}

Message contain all information message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL