.
This commit is contained in:
parent
c143311608
commit
16d4c8b521
@ -16,6 +16,7 @@ func runSendTestNotification(args []string) {
|
||||
email := fs.String("email", "", "Send to all device tokens for this user")
|
||||
deviceToken := fs.String("token", "", "Send to this specific device token")
|
||||
message := fs.String("message", "Test notification", "Notification body")
|
||||
sandbox := fs.Bool("sandbox", false, "Use APNs sandbox (development builds)")
|
||||
fs.Parse(args)
|
||||
|
||||
if *email == "" && *deviceToken == "" {
|
||||
@ -38,11 +39,13 @@ func runSendTestNotification(args []string) {
|
||||
fmt.Fprintf(os.Stderr, "apns key: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
client := apns.NewTokenClient(&token.Token{
|
||||
AuthKey: authKey,
|
||||
KeyID: keyID,
|
||||
TeamID: teamID,
|
||||
}).Production()
|
||||
t := &token.Token{AuthKey: authKey, KeyID: keyID, TeamID: teamID}
|
||||
var client *apns.Client
|
||||
if *sandbox {
|
||||
client = apns.NewTokenClient(t).Development()
|
||||
} else {
|
||||
client = apns.NewTokenClient(t).Production()
|
||||
}
|
||||
|
||||
var targets []string
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user