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

Push Notification not sent. APNS Connection 0 Notification transmitted to 'ADeviceToken' APNS Connection 0 Socket Error #1206

Closed
aliasad106 opened this issue Mar 26, 2016 · 11 comments

Comments

@aliasad106
Copy link

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

Parse-Server version 2.2.2

var api = new ParseServer({
databaseURI: databaseUri || databaseUri ,
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'abyaappid',
masterKey: process.env.MASTER_KEY || 'abyamasterkey', //Add your master key here. Keep it secret!
fileKey: process.env.FILE_KEY || '', // Add the file key to provide access to files already hosted on Parse
clientKey: 'abyaclientkey',
push: {

  ios: {
      pfx: 'certificatesdev.p12', // the path and filename to the .p12 file you exported earlier.
      bundleId: 'com.abc.abc', // The bundle identifier associated with your app
      production: false
  }

},
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse' // Don't forget to change to https if needed
});

Steps to reproduce

running this code in afterSave

Parse.Push.send({
where: {
"deviceType": { "$in": [ "ios"] }
},
data: {
"title": "Hello world",
"alert": "Push Notification."
}
}, { useMasterKey: true });
});

Logs/Trace

APNS Connection 0 Notification transmitted to 'ADeviceToken'
APNS Connection 0 Notification transmitted to 'ADeviceToken'
APNS Connection 0 Notification transmitted to 'ADeviceToken'
APNS Connection 0 Notification transmitted to 'ADeviceToken'
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected

@flovilmart
Copy link
Contributor

What's the question?

@aliasad106 aliasad106 changed the title APNS Connection 0 Notification transmitted to 'ADeviceToken' APNS Connection 0 Socket Error Push Notification not sent. APNS Connection 0 Notification transmitted to 'ADeviceToken' APNS Connection 0 Socket Error Mar 26, 2016
@aliasad106
Copy link
Author

Sorry @flovilmart Forgot to mention that Push Notification is not working. I am having local deployment. And trying to send push notification for iOS on after save of a class. Get the above log when the Push.Send gets executed

@flovilmart
Copy link
Contributor

When you say not working, what do you mean? Not getting anything on the device?

@aliasad106
Copy link
Author

@flovilmart yes not getting anything on device. Also I have tested the certificate.p12 with Parse.com and it's working fine there.

@flovilmart
Copy link
Contributor

I'll have a look

@flovilmart
Copy link
Contributor

Can you try setting DEBUG=apn to print the apn debug logs before you start your server?

@aliasad106
Copy link
Author

I did it and I am getting notifications now on device

@flovilmart
Copy link
Contributor

ahah :) so that's all good then :)

@aliasad106
Copy link
Author

What was this command DEBUG=apn? Sorry I am not good in this stuff.
I just ran the command in terminal before starting the server. Do I need to write it somewhere before deploying ?

@aliasad106
Copy link
Author

And I am getting this in my log
APNS Connection 0 Notification transmitted to 3a7b9221fa22ae76d7ed9c2ba2de75df86dfca498d10691deb2a58149b847aa0
APNS Connection 0 Notification transmitted to 9b6cc813610a6587b094de232561360b983cc911aded0c4c5d7729a9beb15419
APNS Connection 0 Notification transmitted to 0a34957975072fc1137449bf48e139592779080e8ad8cf46e5c1519cc754ca99

@flovilmart
Copy link
Contributor

that indicates that the notifications are successfully transmitted to the APN sever. however it doesn't indicate if the notification gets delivered to the device.

What did you change to get it delivered to the device?

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