Open mrDoctorWho opened 8 years ago
@mrDoctorWho Hello, I hope this very well. In the module only change the url by -defines (NS_FCM, "https://fcm.googleapis.com/fcm"). and works perfectly in my server!!
Hello mrDoctorWho ,
I have integrated mod_gcm with ejabberd and FCM for Android. I just followed instructions and setup mod_gcm, everything seems to be fine. But when I receive offline message, it is received by mod_gcm but further not sent to FCM.
I could see debug message at server "mod_gcm: got offline message" but when I debugged found out that it is not entering into below case statement where message sent to FCM. Could you please let me know if I am missing anything related to configuration at server or while sending a stanza from client ?
Stanza from client side,
<iq to='my_xmpp_server' from='rahul' id='eMUAt-728' type='set'>
<register xmlns='https://mytestxmppappfcm.firebaseio.com'><key>client token id</key></register>
</iq>
%% Checking subscription
{Subscription, _Groups} =
ejabberd_hooks:run_fold(roster_get_jid_info, ToServer, {none, []}, [ToUser, ToServer, From]),
case Subscription of
Hi @ritheshg,
What is the type of your message?
It is 'Type.chat', I am using Smack library at Android client side and sending 'Message' to other end.
<register xmlns='https://mytestxmppappfcm.firebaseio.com'>
What is that URL? Have you changed it in the code as well? Were there any other changes in the code?
What ejabberd version are you using?
Are there any other modules installed that might rely on offline messages?
-define(NS_GCM, "https://mytestxmppappfcm.firebaseio.com").
Snippet from 'google-services.json'
"project_info": {
"project_number": "417769686398",
"firebase_url": "https://mytestxmppappfcm.firebaseio.com",
"project_id": "mytestxmppappfcm",
"storage_bucket": "mytestxmppappfcm.appspot.com"
},
I am using ejabberd version 16.04.61
Using below but same state is observed even after disabling this module.
mod_offline:
access_max_user_messages: max_user_offline_messages
Flow does not get into case statement at server.
I don't think the execution flow could just stop on this. Did it go through the case below?
case Type of
"normal" -> ok;
_ ->
Yes, It got into "normal" -> ok; and executed below statement.
{Subscription, _Groups} =
ejabberd_hooks:run_fold(roster_get_jid_info, ToServer, {none, []}, [ToUser, ToServer, From])
So, do your users have subscription both?
Yes, both the users have subscribed. And below debug messages are shown for both the users,
mod_gcm: updating last_seen for user [username]
@ritheshg Could you please check if the original module works fine for you?
Hello @mrDoctorWho , @ritheshg , @dverdugo85 any one know how to FCM pushnotification in ejabberd same like below GCM link: https://github.com/joanlopez/ejabberd-mod-gcm https://github.com/joanlopez/ejabberd-mod-gcm/blob/master/src/mod_gcm.erl
Please help me if there is any mod_fcm.erl file I have installed 16.09 ejabberd version.
@nileshbacancy I don't know if there's any
Firebase is to replace GCM by April 11, 2019. I probably should have a look into that.
https://firebase.google.com/docs/cloud-messaging/send-message