Repository navigation
Closed
Description
Issue Description
When sending a push from Cloud Code in 2.5.3, the notification seems to hang while being sent. On the Dashboard, the status of the push remains as sending. With VERBOSE=1, the logs don't show anything beyond the "sending push to X installations" step. No push notification is received on the device. Pushes seem to be working fine on Android/GCM.
This is not an issue in 2.4.2 for me, and only occurs when I upgrade to 2.5.3.
Steps to reproduce
I am running a simple Cloud Code function that sends a push notification to a single installation:
Parse.Cloud.define("testPush", function(request, response) {
Parse.Push.send({
channels: [ USER_CHANNEL ],
expiration_interval: 15,
data: {
alert: request.params.message,
title: "GreatApp"
}
}, {
useMasterKey: true
}).then(function() {
response.success("OK");
});
});
My parse-server push configuration is as follows:
push: {
android: {
senderId: 'XYZ',
apiKey: 'XYZ'
},
ios: [
{
pfx: __dirname + '/certs/prod.p12',
bundleId: 'com.GreatApp',
production: true
},
{
pfx: __dirname + '/certs/dev.p12',
bundleId: 'com.GreatApp',
production: false
}
]
},
Environment Setup
- Server
- parse-server version: 2.5.3
- Heroku
Logs/Trace
On parse-server 2.4.2, the push is received on my iOS device:
12:18:30 web.1 | verbose: REQUEST for [POST] /parse/push: {
12:18:30 web.1 | "channels": [
12:18:30 web.1 | "user_xyz"
12:18:30 web.1 | ],
12:18:30 web.1 | "data": {
12:18:30 web.1 | "alert": "This is a push!",
12:18:30 web.1 | "title": "GreatApp"
12:18:30 web.1 | },
12:18:30 web.1 | "expiration_interval": 15
12:18:30 web.1 | } method=POST, url=/parse/push, user-agent=node-XMLHttpRequest, Parse/js1.9.2 (NodeJS 5.12.0), accept=*/*, content-type=text/plain, host=localhost:1337, content-length=307, connection=close, channels=[user_xyz], alert=This is a push!, title=GreatApp, expiration_interval=15
12:18:30 web.1 | verbose: RESPONSE from [POST] /parse/push: {
12:18:30 web.1 | "headers": {
12:18:30 web.1 | "X-Parse-Push-Status-Id": "kdst8cZERc"
12:18:30 web.1 | },
12:18:30 web.1 | "response": {
12:18:30 web.1 | "result": true
12:18:30 web.1 | }
12:18:30 web.1 | } X-Parse-Push-Status-Id=kdst8cZERc, result=true
12:18:30 web.1 | info: Ran cloud function testPush for user XYZ with:
12:18:30 web.1 | Input: {"message":"This is a push!"}
12:18:30 web.1 | Result: "OK" functionName=testPush, message=This is a push!, user=XYZ
12:18:30 web.1 | verbose: RESPONSE from [POST] /parse/functions/testPush: {
12:18:30 web.1 | "response": {
12:18:30 web.1 | "result": "OK"
12:18:30 web.1 | }
12:18:30 web.1 | } result=OK
12:18:30 web.1 | verbose: _PushStatus kdst8cZERc: sending push to 1 installations
12:18:30 web.1 | verb
12:18:30 web.1 | parse-server-push-adapter APNS
12:18:30 web.1 | APNS Connection 0 Connected
12:18:30 web.1 | verb
12:18:30 web.1 | parse-server-push-adapter APNS APNS Connection 0 Notification transmitted to 5c1...(device token)
12:18:30 web.1 | verbose: _PushStatus kdst8cZERc: sent push! 0 success, 0 failures
On parse-server 2.5.3, the push is not received:
12:22:56 web.1 | verbose: REQUEST for [POST] /parse/push: {
12:22:56 web.1 | "channels": [
12:22:56 web.1 | "user_xyz"
12:22:56 web.1 | ],
12:22:56 web.1 | "data": {
12:22:56 web.1 | "alert": "This is a push!",
12:22:56 web.1 | "title": "GreatApp"
12:22:56 web.1 | },
12:22:56 web.1 | "expiration_interval": 15
12:22:56 web.1 | } method=POST, url=/parse/push, user-agent=node-XMLHttpRequest, Parse/js1.10.0 (NodeJS 5.12.0), accept=*/*, content-type=text/plain, host=localhost:1337, content-length=308, connection=close, channels=[user_xyz], alert=This is a push!, title=GreatApp, expiration_interval=15
12:22:56 web.1 | verbose: RESPONSE from [POST] /parse/push: {
12:22:56 web.1 | "headers": {
12:22:56 web.1 | "X-Parse-Push-Status-Id": "nOEjLtSWcO"
12:22:56 web.1 | },
12:22:56 web.1 | "response": {
12:22:56 web.1 | "result": true
12:22:56 web.1 | }
12:22:56 web.1 | } X-Parse-Push-Status-Id=nOEjLtSWcO, result=true
12:22:56 web.1 | info: Ran cloud function testPush for user XYZ with:
12:22:56 web.1 | Input: {"message":"This is a push!"}
12:22:56 web.1 | Result: "OK" functionName=testPush, message=This is a push!, user=XYZ
12:22:56 web.1 | verbose: RESPONSE from [POST] /parse/functions/testPush: {
12:22:56 web.1 | "response": {
12:22:56 web.1 | "result": "OK"
12:22:56 web.1 | }
12:22:56 web.1 | } result=OK
12:22:56 web.1 | verbose: _PushStatus nOEjLtSWcO: sending push to 1 installations
Metadata
Metadata
Assignees
Labels
No labels
Activity
jeffreyjackson commentedon Jul 14, 2017
I'm experiencing the same issue
jeffreyjackson commentedon Jul 14, 2017
I can confirm this. I reverted back to the 2.4.2 and I am now receiving push notifications like I used to.
nathan-charles commentedon Jul 14, 2017
It's something to do with the title property. I commented that out and push is working again on 2.5.3
flovilmart commentedon Jul 14, 2017
What title property?
dplewis commentedon Jul 14, 2017
https://github.com/parse-server-modules/parse-server-push-adapter/blob/02bfda8c78f783a5bf8d4562fcafd15c9ef577c6/src/APNS.js#L181
Shouldn't this be
setTitleinstead ofsetAlertTitlejeffreyjackson commentedon Jul 15, 2017
I think @dplewis is correct
dplewis commentedon Jul 15, 2017
https://github.com/node-apn/node-apn/blob/master/lib/notification/apsProperties.js#L37
flovilmart commentedon Jul 15, 2017
Ok that’s an issue in the adapter. Can we open it there?
flovilmart commentedon Jul 15, 2017
As a work around, you can use alert: { title: «title » }
sfertman commentedon Aug 8, 2017
I saw that the issue was fixed in parse-modules/parse-server-push-adapter but the fix is not marked "latest" and npm still pulls the buggy version on install
uhw76tgwquerhjbqwnejk commentedon Aug 16, 2017
npm still pulling the buggy version as well for me
riccardoch commentedon Oct 5, 2017
This issue has not yet been solved. How can I force to install the last version of parse-server-push-adapter?
gatthias commentedon Oct 6, 2017
Indeed it still breaks if title is set as in doc. However as @flovilmart suggested, you can use :
In that case, if you still want a message besides this title (which most of us would), you can use the property "body", giving :
{ "title": "MyTitle", "body": "MyMessage" }Which should be set as the notification "data" field value. In case it's still not clear, use this way :
Just tested with latest Parse & Parse Server, all good.
Bonus, you get title for iOS devices too (If I'm correct on the 'old' title way).
riccardoch commentedon Oct 6, 2017
@opulisDynamics Thanks, but It's not good for me to change the JSON, because the notifications are sent by embedded devices and I have a lot of those distributed and update the software on all of them only for this reason is not good, so the best solution for me (at the moment) was to edit parse-server-push-adapter, like someone has suggested.
flovilmart commentedon Oct 6, 2017
It just need a release The latests version from master then!
stale commentedon Sep 18, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.