Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename variable #6

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apns2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func main() {
certificatePath := flag.String("certificate-path", "", "Path to certificate file.")
authKeyPath := flag.String("authkey-path", "", "path to the P8 file. (Certificates, Identifiers & Profiles -> Keys)")
p8FilePath := flag.String("authkey-path", "", "path to the P8 file. (Certificates, Identifiers & Profiles -> Keys)")
keyID := flag.String("key-id", "", "Key ID from developer account (Certificates, Identifiers & Profiles -> Keys)")
teamID := flag.String("team-id", "", "Team ID from developer account (View Account -> Membership)")
topic := flag.String("topic", "", "The topic of the remote notification, which is typically the bundle ID for your app")
Expand All @@ -31,11 +31,11 @@ func main() {
log.Fatalf("Error retrieving certificate `%v`: %v", certificatePath, pemErr)
}
client = apns2.NewClient(cert)
} else if *authKeyPath != "" || *teamID != "" || *keyID != "" {
authKey, authErr := token.AuthKeyFromFile(*authKeyPath)
} else if *p8FilePath != "" || *teamID != "" || *keyID != "" {
authKey, authErr := token.AuthKeyFromFile(*p8FilePath)

if authErr != nil {
log.Fatalf("Error retrieving Token `%v`: %v", authKeyPath, authErr)
log.Fatalf("Error retrieving Token `%v`: %v", p8FilePath, authErr)
}

authToken := &token.Token{
Expand Down
Loading