apns2 icon indicating copy to clipboard operation
apns2 copied to clipboard

APNs urls should be in a config file

Open keremoge opened this issue 2 years ago • 1 comments

Hi, I think you should consider getting the push urls from a config file, and it should be optional for the consumer to change it when calling apns2 api;

// Apple HTTP/2 Development & Production urls
const (
	HostDevelopment = "https://api.sandbox.push.apple.com"
	HostProduction  = "https://api.push.apple.com"
)

keremoge avatar Oct 18 '21 10:10 keremoge

Hi @keremoge

You can already override the URL's if needed

The first way is to set the default host before you init a client:

apns2.DefaultHost = "api.mycustomdomain.com"

Alternatively, set the host after you have called NewClient / NewTokenClient:

client := apns2.NewTokenClient(token)
client.Host = "api.mycustomdomain.com"

Hope that helps

sideshow avatar Mar 27 '22 04:03 sideshow