Description
Hi. We’ve made a custom build of the RC client for Apple devices and generated all certificates/keys that work in test app that does pushes messages to our phones.
Then we set up our RC server (snap 3.6.2) to use these keys instead of push gateway.
But when I press send test push message I get no push but this records in server log:
I20201023-15:57:44.125(3) Push ➔ debug Sending notification { createdAt: 2020-10-23T12:57:44.123Z, createdBy: ‘’, sent: false, sending: 0, from: ‘push’, title: ‘@testuser ’, text: ‘This is a push test message’, userId: ‘someuserid’, sound: ‘default’, apn: { text: ‘@testuser : This is a push test message’ } }
I20201023-15:57:44.126(3) Push ➔ debug send message “@testuser ” to userId someuserid
I20201023-15:57:44.127(3) Push ➔ debug send to token { apn: ‘someAPN’ }
I20201023-15:57:44.131(3) Push ➔ debug send to token { apn: ‘someAPN’ }
I20201023-15:57:44.133(3) Push ➔ debug Could not send notification id: “undefined”, Error: Cannot read property ‘send’ of undefined
I20201023-15:57:44.134(3) Push ➔ debug TypeError: Cannot read property ‘send’ of undefined
at sendAPN (app/push/server/apn.js:48:16)
at PushClass.sendNotificationNative (app/push/server/push.js:87:5)
at app/push/server/push.js:203:16
at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1138:16)
at Cursor. [as forEach] (packages/mongo/mongo_driver.js:918:44)
at PushClass.sendNotification (app/push/server/push.js:196:35)
at PushClass.send (app/push/server/push.js:320:9)
at MethodInvocation.push_test (server/lib/pushConfig.js:56:8)
at MethodInvocation.methodsMap. (app/lib/server/lib/debug.js:67:34)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
at packages/ddp-server/livedata_server.js:719:19
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at packages/ddp-server/livedata_server.js:717:46
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at packages/ddp-server/livedata_server.js:715:46
at new Promise ()
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43
Server Setup Information
Version of Rocket.Chat Server: 3.6.2
Operating System: Ubuntu 18
Deployment Method: snap
Number of Running Instances: 1
DB Replicaset Oplog: Enabled
NodeJS Version:
MongoDB Version: 3.6.14
Proxy: nginx
Firewalls involved:
LBusch
November 10, 2020, 1:52pm
2
We are facing the excact same Problem, have you found a solution to this?
We are facing this problem too. Any update?
No… What server version do you run? I think that may be it is old snap server bug and we should switch to local/docker version.
We are facing the same problem, our server version is 3.8.1
Snap 3.8.1 was delivered yesterday or so.
Does it still have problems?
Yes, we still get this error
I20201123-13:04:28.151(1) Push ➔ debug Sending notification { createdAt: 2020-11-23T12:04:28.150Z, createdBy: ‘’, sent: false, sending: 0, from: ‘push’, title: ‘Administrator’, text: ‘Hello World’, userId: ‘W4QNfnLJTHrhuqtPK’, payload: { host: ‘outHost’, messageId: ‘P5MB3ehrQyanv5brQ’, notificationType: ‘message’, rid: ‘W4QNfnLJTHrhuqtPKraRipWRJH6GQNmB2i’, sender: { _id: ‘raRipWRJH6GQNmB2i’, username: ‘admin’ }, senderName: ‘Administrator’, type: ‘d’ }, badge: 3, sound: ‘default’, notId: 1243802258, apn: { category: ‘MESSAGE’ }, gcm: { image: ‘outHostFavicon’, style: ‘inbox’ } }
I20201123-13:04:28.151(1) Push ➔ debug send message “Administrator” to userId W4QNfnLJTHrhuqtPK
I20201123-13:04:28.156(1) Push ➔ debug send to token { apn: ‘someAPN’ }
I20201123-13:04:28.159(1) Push ➔ debug send to token { apn: ‘someAPN’ }
I20201123-13:04:28.161(1) Push ➔ debug Could not send notification id: “undefined”, Error: Cannot read property ‘send’ of undefined
I20201123-13:04:28.162(1) Push ➔ debug TypeError: Cannot read property ‘send’ of undefined
at sendAPN (app/push/server/apn.js:48:16)
at PushClass.sendNotificationNative (app/push/server/push.js:87:5)
at app/push/server/push.js:208:16 at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1138:16)
at Cursor. [as forEach] (packages/mongo/mongo_driver.js:918:44)
at PushClass.sendNotification (app/push/server/push.js:201:35)
at PushClass.send (app/push/server/push.js:325:9)
at PushNotification.send (app/push-notifications/server/lib/PushNotification.js:70:15)
at NotificationClass.push (app/notification-queue/server/NotificationQueue.ts:95:20)
at app/notification-queue/server/NotificationQueue.ts:67:12
at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
I also tried to downgrade to 3.7 but nothing happen, still can’t make the push notification run
Have you managed to solve this, I have the same problem?
Ya, had the same problem myself. The line of code is:
apnConnection.send(note, userToken)
The apnConnection gets initialized when the RC server starts. So do a restart and this error will be resolved. Either the iOS notifications will work then (lucky me) or you’ll get a different error in the server log.
Had same issue on 4.8.7
Private key and/or format how it was pasted into config was wrong.
Exporting apple push certificate from .p12
openssl pkcs12 -in cert.p12 -out newfile.crt.pem -clcerts -nokeys
openssl pkcs12 -in cert.p12 -out newfile.key.pem -nocerts -nodes
Then putting the full output into Push configuration,
Format like
Bag Attributes
friendlyName: something
localKeyID: 7D EE 03 27 E2 00 7D 88 BC 01 BE 75 C5 00 B7 59 00 7E 2A 64
Key Attributes:
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4iL3yU/lfBGLE
Rg+56Ce4Oko4Ak/5lQ5SlM7rGEo3wT/DpY2L25NXXXeynYpi1raovLKaTiqo/KmI
54V882TAN03uI8LL2u41Y+DLyOsoZEzJqCOwfagoxqZiDgkIhfK8L3joIQXYu7T/
9K24c6LTJ8eIImZRxSisMfXTefXwlj3igM20hTpRJhWCSuWvu55oJN4ykB/GsyGH
QRxMHu43s+Kus9vP2t/1aP09FE0YWhLHwuyxf6pu/0zjySI6SIyG3HucGxgE/RMj
1IzoYJIQXAnmi27sekUHxKQA4KLL9i4QK5agdSVTypBgI9qIZIGoF/JrBhfQ21oG
ulROjNXfAgMBAAECggEAbkwtXJ6cuxJgBnjqBXCh7RfKLNgU/VT+jpWraBHIqrKz
bjmR9Tp1Qw728KgBgzpbS1ge000000HSY6Yev6SrX8iup9xwHnDpWLguMSASjr4E
t7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hYZ1wLQ0qkiT7y/tjET1MGK
fzFHDjGapd4ZtS+iUhKm4vg=
-----END PRIVATE KEY-----
Bag Attributes
friendlyName: Apple Push Services: com.something.something
localKeyID: 7D EE 03 27 E2 AD 7D 88 00 00 BE 00 C5 DC B7 59 8F 7E 2A 64
subject=/UID=com.cradon.radonm/CN=Apple Push Services: com.something.random/OU=HV67G3ZRG7/O=Company or something/C=US
issuer=/CN=Apple Worldwide Developer Relations Certification Authority/OU=G4/O=Apple Inc./C=US
-----BEGIN CERTIFICATE-----
MIIG2jCCBcKgAwIBAgIQSnBDOvSyk2uOrEuRBG8vqzANBgkqhkiG9w0BAQsFADB1
MUQwQgYDVQQDDDtBcHBsZSBXb3JsZHdpse4hZGUgRGV2ZWxvcGVyIFJlbGF0aW9ucyBD
ZXJ0aWZpY2F0aW9uIEF1dGhvcml000000AkGA1UECwwCRzQxEzARBgNVBAoMCkFw
cGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTIzMDMzMTEwMjIyMloXDTI0MDQyOTEw
MjIyMVowgbQxJzAlBgoJkiaJk/IsZAEBDBdjb20uY29tbGlua2luYy5waWdlb25y
bjE1MDMGA1UEAwwsQXBwbGUgUHVzaCBTZXJ2aWNlczogY29tLmNvbWxpbmtpbmMu
cGlnZW9ucm4xEzARBgNVBAsMCkhWNjdHM1pSRzcxMDAuBgNVBAoMJ0NvbWxpbmsg
VGVsZWNvbW11bmljYXRpb25zIFNlcnZpY2VzIEluYzELMAkGA1UEBhMCVVMwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4iL3yU/lfBGLERg+56Ce4Oko4
Ak/5lQ5SlM7rGEo3wT/DpY2L25NXXXeynYpi1raose4h6esh6vLKaTiqo/KmI54V882TAN03u
I8LL2u41Y+DLyOsoZEzJqCOwfagoxqZiDgkIhfK8L3joIQXYu7T/9K24c6LTJ8eI
ImZRxSisMfXTefXwlj3igM20hTpRJhWCSuWvu55oJN4ykB/GsyGHQRxMHu43s+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