Skip to content

Push not sent to iOS Device #4

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

Closed
3 tasks done
okaris opened this issue Mar 26, 2016 · 19 comments
Closed
3 tasks done

Push not sent to iOS Device #4

okaris opened this issue Mar 26, 2016 · 19 comments

Comments

@okaris
Copy link

okaris commented Mar 26, 2016

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

Heroku (Performace 1x) + mLab (Dedicated Cluster M3) running parse-server-example with parse-server 2.2.2

Steps to reproduce

`var api = new ParseServer({
databaseURI: databaseUri || '...',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || '...',
masterKey: process.env.MASTER_KEY || '...', //Add your master key here. Keep it secret!
fileKey: ...', //This is needed to display old files on Parse's S3
serverURL: process.env.SERVER_URL || 'http://localhost:1337', // Set to correct url from heroku env
filesAdapter: new S3Adapter(
"...",
"...",
"...",
{directAccess: true, region:"s3-eu-west-1.amazonaws.com"}
),
push: {
ios: [
{
pfx: __dirname + '/development.p12', // Prod PFX or P12
bundleId: 'com.okaris.myapp',
production: false // Prod
},
{
pfx: __dirname + '/production.p12', // Prod PFX or P12
bundleId: 'com.okaris.myapp',
production: true // Prod
}
]
}

});`

Logs/Trace

2016-03-21T20:56:16.089931+00:00 app[web.1]: POST /parse/push { host: 'coralline.herokuapp.com', 2016-03-21T20:56:16.089940+00:00 app[web.1]: connection: 'close', 2016-03-21T20:56:16.089941+00:00 app[web.1]: 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.1 (NodeJS 5.8.0)', 2016-03-21T20:56:16.089942+00:00 app[web.1]: accept: '*/*', 2016-03-21T20:56:16.089943+00:00 app[web.1]: 'content-type': 'text/plain', 2016-03-21T20:56:16.089951+00:00 app[web.1]: 'x-request-id': '9efc6deb-5c34-4e21-9dc1-8c7594f14090', 2016-03-21T20:56:16.089952+00:00 app[web.1]: 'x-forwarded-for': '54.74.165.67', 2016-03-21T20:56:16.089953+00:00 app[web.1]: 'x-forwarded-proto': 'https', 2016-03-21T20:56:16.089953+00:00 app[web.1]: 'x-forwarded-port': '443', 2016-03-21T20:56:16.089954+00:00 app[web.1]: via: '1.1 vegur', 2016-03-21T20:56:16.089954+00:00 app[web.1]: 'connect-time': '0', 2016-03-21T20:56:16.089955+00:00 app[web.1]: 'x-request-start': '1458593776087', 2016-03-21T20:56:16.089956+00:00 app[web.1]: 'total-route-time': '0', 2016-03-21T20:56:16.089956+00:00 app[web.1]: 'content-length': '399' } { 2016-03-21T20:56:16.089957+00:00 app[web.1]: "where": { 2016-03-21T20:56:16.089958+00:00 app[web.1]: "user": { 2016-03-21T20:56:16.089958+00:00 app[web.1]: "__type": "Pointer", 2016-03-21T20:56:16.089959+00:00 app[web.1]: "className": "_User", 2016-03-21T20:56:16.089960+00:00 app[web.1]: "objectId": "BUCrtfWPdz" 2016-03-21T20:56:16.089960+00:00 app[web.1]: } 2016-03-21T20:56:16.089961+00:00 app[web.1]: }, 2016-03-21T20:56:16.089962+00:00 app[web.1]: "data": { 2016-03-21T20:56:16.089962+00:00 app[web.1]: "alert": { 2016-03-21T20:56:16.089963+00:00 app[web.1]: "loc-key": "LikeNotification", 2016-03-21T20:56:16.089963+00:00 app[web.1]: "loc-args": [ 2016-03-21T20:56:16.089964+00:00 app[web.1]: "okaris", 2016-03-21T20:56:16.089965+00:00 app[web.1]: "O" 2016-03-21T20:56:16.089965+00:00 app[web.1]: ] 2016-03-21T20:56:16.089966+00:00 app[web.1]: }, 2016-03-21T20:56:16.089967+00:00 app[web.1]: "badge": "Increment", 2016-03-21T20:56:16.089967+00:00 app[web.1]: "sound": "PopDing.caf" 2016-03-21T20:56:16.089968+00:00 app[web.1]: } 2016-03-21T20:56:16.089969+00:00 app[web.1]: } 2016-03-21T20:56:16.092150+00:00 app[web.1]: response: { 2016-03-21T20:56:16.092160+00:00 app[web.1]: "response": { 2016-03-21T20:56:16.092161+00:00 app[web.1]: "result": true 2016-03-21T20:56:16.092162+00:00 app[web.1]: } 2016-03-21T20:56:16.092163+00:00 app[web.1]: } 2016-03-21T20:56:16.095961+00:00 app[web.1]: ##### PUSH OK

Server logs "PUSH OK" but I don't see any APNS Connection logs, no push is delivered. Tried with both production and development certificates. Certificates don't have passwords. Tried using empty android push config and not. Tried using CURL with same result.

Cloud Code:

var pushQuery = new Parse.Query(Parse.Installation, { useMasterKey: true }); pushQuery.equalTo('user', user); Parse.Push.send({ where: pushQuery, data: { alert: { "loc-key": "LikeNotificationNoContent", "loc-args": [sender.get('screenName')] }, badge: "Increment", sound: "PopDing.caf" } }, { success: function() { console.log('##### PUSH OK'); }, error: function(error) { console.log('##### PUSH ERROR' + error); }, useMasterKey: true });

@firaskafri
Copy link

Can you post your _PushStatus contents from your DB records?

@okaris
Copy link
Author

okaris commented Mar 26, 2016

@firasalkafri I had the same issue on Parse-Server repo. It is closed but it isn't fixed for me. parse-community/parse-server#1127

@firaskafri
Copy link

@okaris I know, I'm having the same problem with GCM

@firaskafri
Copy link

@okaris I can confirm the GCM adapter is working now, can you clone parse-server and use it in your project instead of the one you installed through npm?

@okaris
Copy link
Author

okaris commented Mar 28, 2016

@firasalkafri I tried pointing parse-server git as a dependency but when I do my build fails, node can't find parse-server module - even though i can see it in node_modules

@flovilmart
Copy link
Contributor

@okaris yes it can't because the lib folder is not under version control.

@firaskafri
Copy link

My testing environment is currently messed up but can you try linking the cloned repo to your project and then install from source?

@okaris
Copy link
Author

okaris commented Mar 29, 2016

@flovilmart Is there a way I can use the latest repo from github in my project? I tried using the parse-server-push-adapter as you told. I have initiated the adapter and passed the adapter for the push: parameter to the Parse-Server. But it throws an iterator error from ParsePushAdapter.js

@yaalaa
Copy link

yaalaa commented Mar 30, 2016

Hi folks,
It's definitely not delivering notifications.
Here's what I see in the log:

verb parse-server-push-adapter APNS APNS Connection 0 Connected
verb parse-server-push-adapter APNS APNS Connection 0 Notification transmitted to <mydevicetoken>
ERR! parse-server-push-adapter APNS cannot find vaild connection for <mydevicetoken>
verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
verb parse-server-push-adapter APNS APNS Connection 0 Connected

@okaris
Copy link
Author

okaris commented Mar 30, 2016

ERR! parse-server-push-adapter APNS no qualified connections for

@flovilmart
Copy link
Contributor

Thierry occurs when no valid configuration is available to send your push. Check your certificates, configuration as well as bundleId

@yaalaa
Copy link

yaalaa commented Mar 30, 2016

@flovilmart is it for me or @okaris ?:)

@okaris
Copy link
Author

okaris commented Mar 30, 2016

@flovilmart bundleId and p12 files are the same ones I use on Hosted Parse. I've also tested that their path is correct and the files exist on the server.

@okaris
Copy link
Author

okaris commented Mar 30, 2016

@flovilmart solved it. I have rechecked and rechecked everything from scratch. i made a typo in the bundleId. one letter was lowercase instead of uppercase. sorry for the trouble. keep up the goodwork. Thanks especially for the parse-image wrapper. saved me a ton of time!

issue can be closed

@yaalaa
Copy link

yaalaa commented Mar 30, 2016

folks, please take a look at my log.
it looks not so good :(

@flovilmart
Copy link
Contributor

@yaalaa the @okaris issue is solved. Please check your parameters as well. This is clearly not an issue as many users manage to make it work correctly.

@okaris
Copy link
Author

okaris commented Mar 30, 2016

@yaalaa make sure your certificates are not password protected. follow the push guide on parse-server. and make sure your bundleId is exactly as you use in developer member center at apple.

@yaalaa
Copy link

yaalaa commented Mar 30, 2016

I duped parse app which had push working good. So all parameters look good.

@flovilmart
Copy link
Contributor

guys, take it to stack overflow as this is clearly not an error from this module.

verb parse-server-push-adapter APNS APNS Connection 0 Connected
verb parse-server-push-adapter APNS APNS Connection 0 Notification transmitted to <mydevicetoken>
ERR! parse-server-push-adapter APNS cannot find vaild connection for <mydevicetoken>
verb parse-server-push-adapter APNS APNS Connection 0 Disconnected
verb parse-server-push-adapter APNS APNS Connection 0 Connected
``` 

That means that your configuration is incorrect for your devices, like using a prod certificate for a dev device token and the opposite. The certificate can manage to connect but APN rejects your request.

@parse-community parse-community locked and limited conversation to collaborators Mar 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants