-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprovider.go
25 lines (18 loc) · 921 Bytes
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package push
import (
"context"
)
type Provider interface {
// IsValidPushToken validates whether a push token is valid
IsValidPushToken(ctx context.Context, pushToken string) (bool, error)
// SendPush sends a basic push notication with a title and body
SendPush(ctx context.Context, pushToken, title, body string) error
// SendLocalizedAPNSPush sends a localized APNS push
SendLocalizedAPNSPush(ctx context.Context, pushToken, titleKey, bodyKey string, bodyArgs ...string) error
// SendLocalizedAndroidPush sends a localized Android push
SendLocalizedAndroidPush(ctx context.Context, pushToken, titleKey, bodyKey string, bodyArgs ...string) error
// SendDataPush sends a data push
SendDataPush(ctx context.Context, pushToken string, kvs map[string]string) error
// SetAPNSBadgeCount sets the badge count on the iOS app icon
SetAPNSBadgeCount(ctx context.Context, pushToken string, count int) error
}