noodlewerk / NWPusher

OS X and iOS application and framework to play with the Apple Push Notification service (APNs)
BSD 2-Clause "Simplified" License
6.3k stars 679 forks source link

Unable to connect #85

Open prabhatVinsol opened 2 years ago

prabhatVinsol commented 2 years ago

When selecting the certificate this error is coming "Unable to connect: Socket connecting failed (-1)"

Not able to find any help to figure out why this is happening and how to fix this.

pertau commented 2 years ago

Same here.

The macOS app works fine, but the push from iOS code fails with this error.

dhiren92 commented 2 years ago

same here

saormart commented 2 years ago

Same here....

saormart commented 2 years ago

It seems that this issue is something to do with the legacy Binary Interface (gateway.push.apple.com) which was retired March 31st, 2021 (https://developer.apple.com/news/?id=c88acm2b). It includes the sandbox as well...

newpgt commented 2 years ago

same...

cloverfiled344 commented 2 years ago

same...

Biolazard commented 2 years ago

same.

Ian-Seungho-Lee commented 2 years ago

+1

georgbachmann commented 2 years ago

Same here... :( does anybody know an alternative that is still working?

BratislavBaljak commented 2 years ago

Same here

tmaly1980 commented 2 years ago

Any luck?

MagFer commented 2 years ago

Same here

image
MagFer commented 2 years ago

I've seen there are some contributors listed in the repo let's see if someone knows how to fix it 🤔.

Sergey70 commented 2 years ago

same

yawillianpsb commented 2 years ago

"Unable to connect: Socket connecting failed (-1)" means that you trying establish connection which cannot be established. In my case i've created new push certificates, and push certificates named by new prefix like Apple Sandbox Push Services: instead of Apple Development IOS Push Services: . So I need to use API which doesn't implemented in NWPusher. You can interact with new API via curl requests from terminal as described in documentation here1 and here2 In my case code for terminal is:

DEVICE_TOKEN=enter_here_your_device_token; \
TOPIC=enter.here.bundleId.of.App; \
CERTIFICATE_FILE_NAME=path_to_CER_format_of_push_certificate; \
CERTIFICATE_KEY_FILE_NAME=path_to_PEM_format_of_push_certificate; \
APNS_HOST_NAME=api.sandbox.push.apple.com; \
curl -v \
--header "apns-topic: ${TOPIC}" \
--header "apns-push-type: alert" \
--cert "${CERTIFICATE_FILE_NAME}" --cert-type DER \
--key "${CERTIFICATE_KEY_FILE_NAME}" --key-type PEM \
--data '{"aps":{"alert":"test"}}' \
--http2  https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN}