-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Can't send push to iOS device from Cloud Code. #1127
Comments
Can you get the content from the _PushStatus collection? |
|
ok, seems that either the status is not properly reported OR your query don't match any user. Can you verify the latter? and that the installation properly has a deviceToken? numSent and numFailed are properly set, that means the push has properly callback'd, but no responses were set |
@flovilmart The query matches a user. I have got this from a CURL request and I have set the user to the user on my own device and made sure it has the right deviceId (and there is only one installation with these values). I also don't see any logs about APNS Connection even if I have VERBOSE=1 set |
I'll have a look. The query should match an installation. |
Installation:
|
sounds valid... I'll have a deeper look |
I'm having the same exact problem but with GCM, any updates? |
I'm running on 2.2.2 and I have the same issue with GCM. No logs at all. But I get APNS connections logs, but the notification never reaches the phone. They time out one hour after sending. I have not reconfigured my ios app since migration, except for the server URL. That might be the issue under iOS. For android I have no clue. I double checked all configurations. How can I get a hold of the pushStatus? |
@flovilmart opened the issue also on the new repo on parse server modules, but currently even if i state my dependency as 2.2.2 i can't get the version with push on a seperate module, so i am writing here. where are we with this? I am seeing 3-4 more people having a similar problem. Thank you |
@okaris this is normal, we haven't released the change to npm yet. However, if you want to use the parse-server-push-adapter from parse-server-modules, you can still do it. Add it as a dependency, and initialize it With the same options you'd pass to the push options. Then pass the initialized push adapter to the push option when initializing ParseServer |
@okaris @flovilmart @firasalkafri NOTE: My server is a fork of this repo: https://github.com/codepath/parse-server-example It has just about everything set up for iOS/android. I was having this exact problem with this code in my index.js:
I am also using a fork of the parse-server-example, so I couldn't understand why the notifications weren't going through. I simply uploaded my .p12 file to my fork and boom, the notifications started coming through. View the picture to see where I uploaded my.p12 development certificate! |
@okaris can you retry today, updating parse-server to the latest version? We have a numerous of reports that with a proper configuration, push are being correctly sent. |
@flovilmart i followed up on the adapter repo. Eveything is ok now you can close the issue. Thanks! |
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 (Hobby) + mLab (shared cluster) running parse-server-example with parse-server 2.2.0
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 });
The text was updated successfully, but these errors were encountered: