Documentation
¶
Overview ¶
Package push receives notifications from your server: APNs on iOS, and Firebase Cloud Messaging on Android.
nimbus native plugin add push
Android needs your Firebase project's google-services.json, at native/android/app/google-services.json. On iOS, turn on Push Notifications for the app in your Apple developer account.
ok, err := push.Request(ctx)
t, err := push.GetToken(ctx)
// send t.Value and t.Service to your server
go push.Watch(ctx, func(m push.Message) { openOrder(m.Data["order"]) })
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct {
Title string `json:"title"` // its heading
Body string `json:"body"` // its text
Data map[string]string `json:"data"` // what your server sent with it
Tapped bool `json:"tapped"` // whether they tapped it to get here
}
Message is a notification that arrived while the app was open, or one that was tapped.
Click to show internal directories.
Click to hide internal directories.