-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add sandbox URL to ApnsHttp2 dispatcher #392
Conversation
Was getting `URI::InvalidURIError, bad URI(is not URI?)` when trying to send Apns2 notifications with `app.environment` set to `sandbox`.
Hey and thanks for your PR. I don't use APNS myself, but it seems the endpoints are just development and production. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html According to node-apn/node-apn#528 this got changed at some point, sandbox being removed. Do you think this change is necessary considering the docs? |
I would say so, at least in considering consistency within the codebase. See this (albeit old) comment and the current validation for the APNs app model. |
Our team recently encountered the same issue. We were getting This PR was very helpful in figuring out the cause of this issue, and how to fix it. I wanted to provide feedback on how we resolved it in our application. Hopefully this will help others that may run across the same thing. The short answer is that we only needed to make changes to how data was being stored. As @aried3r mentioned, it seems that Apple changed the hostname of their APNS server. What was once As @brianlittmann said, the validations require the environment to be one of the following: We were able to resolve the issue by taking the following steps:
Once we made the two changes described above, the |
@gregblake, thanks for the long and elaborate answer! What do you suggest we do? Personally I'd rather document this properly somewhere and leave it as is. Or even better, document it and leave a deprecation warning, but I doubt people will see it if it runs as a daemon. |
Merging this. There's no harm in a duplicate environment name, but there is harm in |
Add sandbox URL to ApnsHttp2 dispatcher
Was getting
URI::InvalidURIError, bad URI(is not URI?)
when trying to send Apns2 notifications withapp.environment
set tosandbox
.