Skip to content

Commit

Permalink
chore(apns): add mode logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Aug 1, 2023
1 parent 7950c7d commit 7743fc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion push/apns/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ var cert tls.Certificate
var client *apns2.Client

func init() {
log.Debug().Msg("init apns")
var err error
cert, err = certificate.FromPemFile(config.Config.APNSKeyPath, "")
if err != nil {
log.Fatal().Err(err).Str("scope", "init APNs").Msg("APNs cert error")
}
if config.Config.Mode == "dev" {
client = apns2.NewClient(cert).Development()
log.Debug().Msg("init apns; use development mode")
} else {
client = apns2.NewClient(cert).Production()
log.Debug().Msg("init apns; use production mode")
}
}

0 comments on commit 7743fc5

Please sign in to comment.