From 16d4c8b521d39bf885ed2876095cc73fc4e37768 Mon Sep 17 00:00:00 2001 From: Vicente Ferrari Smith Date: Sun, 10 May 2026 16:48:48 +0200 Subject: [PATCH] . --- cmd/party/send_test_notification.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/party/send_test_notification.go b/cmd/party/send_test_notification.go index e181c74..bd1b5f7 100644 --- a/cmd/party/send_test_notification.go +++ b/cmd/party/send_test_notification.go @@ -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