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

APNs urls should be in a config file #188

Open
keremoge opened this issue Oct 18, 2021 · 1 comment
Open

APNs urls should be in a config file #188

keremoge opened this issue Oct 18, 2021 · 1 comment

Comments

@keremoge
Copy link

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"
)
@sideshow
Copy link
Owner

sideshow commented Mar 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants