Closed ghost closed 5 years ago
Same issue here. Was working a few days ago but suddenly isn't.
If you restart the server does it start working again?
@geekgonecrazy it does not work
Anything new on this issue? I am also experiencing this on v0.65.1
Are you using our push gateway or did you add your own GCM/APN information in the push section?
Also are you using with our mobile apps from the stores?
Edit : found the solution here https://github.com/RocketChat/Rocket.Chat/issues/4909#issuecomment-279866436 Experiencing the same "issue" but I'm not sure to understand how to configure my RC instance.
Here : https://rocket.chat/docs/administrator-guides/notifications/push-notifications/, I disabled the gateway but nothing explain what to do with firebase keys and RC push settings.
Cheers
@geekgonecrazy I am using my own GCM credentials and using react-native apps built from the source and configured to use my own sender id.
@magicbelette did you upgrade reactnative app to FCM from GCM?
Seems to be fixed with 0.66.0 using FCM credentials instead of GCM.
Th his is awesome news. Awesome
On Jun 30, 2018 at 8:16 PM,
wrote: Seems to be fixed with 0.66.0 using FCM credentials instead of GCM.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@aramix Yes, I'm using FCM credentials.
My problem is that my server must access Firebase servers through HTTPS_PROXY but I can't find where to configure it...
Set it as an env var and restart server meteor should use it automatically once there is an env var
I already tried within the init script as I'm using systemd to run Rocket.chat
Environment=NODE_ENV=production HTTPS_PROXY=https://my.proxy.local:3128 HOME=<ROCKET_HOME>...
https://rocket.chat/docs/installation/manual-installation/pm2-systemd-upstart/
hmm.. can't help much. I am using mup to deploy my server
My proxy only authorizes requests to https://fcm.googleapis.com/. Maybe that's not the good URL to contact firebase servers :thinking: ?
A lot has changed here. Going to go ahead and close
hi. I have the same problem. I am using rocket chat server version 3.12.1 and already set the firebase server key and sender id in Push settings and restart multiple times. default cloud gateway works well and delivers messages to devices, but the self-configured mode does not. I tried to reproduce this part:
https://github.com/RocketChat/Rocket.Chat/blob/develop/app/push/server/gcm.js
using my log data and executed on:
https://npm.runkit.com/meteor
but error doesn't occur and Push Notification delivers to the device successfully.
What kind of problems may lead to ANDROID ERROR: result of sender: undefined
?
var gcm = require('node-gcm');
var sender = new gcm.Sender('fcm_server_key');
var userTokens = [ 'firebase_user_token' ]
var notification = { createdAt: '2021-09-09T18:46:47.180Z', createdBy: '<SERVER>', sent: false, sending: 0,
from: 'push', title: 'MyTitle', text: 'test', userId: 'uid',
payload: { host: 'myHost', messageId: 'mid', notificationType: 'message',
rid: 'rid', sender: { _id: 'sid', username: 'uname', name: 'name' },
senderName: 'sname', type: 'd' },
badge: 2, sound: 'default', notId: 257066178, apn: { category: 'MESSAGE' },
gcm: { image: 'myhost/assets/favicon_192.png', style: 'inbox' },
image: 'myHost/assets/favicon_192.png', style: 'inbox' }
console.log('sendGCM', userTokens, notification);
const data = notification.payload ? { ejson: JSON.stringify(notification.payload) } : {};
data.title = notification.title;
data.message = notification.text;
if (notification.image != null) {
data.image = notification.image;
}
if (notification.android_channel_id != null) {
data.android_channel_id = notification.android_channel_id;
} else {
console.log('For devices running Android 8.0 or later you are required to provide an android_channel_id.
See https://github.com/raix/push/issues/341 for more info');
}
if (notification.badge != null) {
data.msgcnt = notification.badge;
}
if (notification.sound != null) {
data.soundname = notification.sound;
}
if (notification.notId != null) {
data.notId = notification.notId;
}
if (notification.style != null) {
data.style = notification.style;
}
if (notification.summaryText != null) {
data.summaryText = notification.summaryText;
}
if (notification.picture != null) {
data.picture = notification.picture;
}
if (notification.actions != null) {
data.actions = notification.actions;
}
if (notification.forceStart != null) {
data['force-start'] = notification.forceStart;
}
if (notification.contentAvailable != null) {
data['content-available'] = notification.contentAvailable;
}
console.log(data)
const message = new gcm.Message({
collapseKey: notification.from,
// Requires delivery of real-time messages to users while device is in Doze or app is in App Standby.
// https://developer.android.com/training/monitoring-device-state/doze-standby#exemption-cases
priority: 'high',
// delayWhileIdle: true,
// timeToLive: 4,
// restricted_package_name: 'dk.gi2.app'
data,
});
console.log(message)
sender.send(message, userTokens, 5, function(err, result) {
if (err) {
console.log({ msg: 'ANDROID ERROR: result of sender', result });
return;
}
if (result === null) {
console.log('ANDROID: Result of sender is null');
return;
}
console.log({ msg: 'ANDROID: Result of sender', result });
if (result.canonical_ids === 1 && userToken) {
try {
_replaceToken({ gcm: userToken }, { gcm: result.results[0].registration_id });
} catch (err) {
console.log({ msg: 'Error replacing token', err });
}
}
if (result.failure !== 0 && userToken) {
try {
_removeToken({ gcm: userToken });
} catch (err) {
console.log({ msg: 'Error removing token', err });
}
}
});```
Description:
During push notification error occurs and we do not get any notifications. More info below.
Server Setup Information:
Steps to Reproduce:
Expected behavior:
We get notification on android.
Actual behavior:
We get an error without any notification on android.
Relevant logs: