Push notification in MongooseIM

Home Forums MongooseIM Push notification in MongooseIM

This topic contains 4 replies, has 3 voices, and was last updated by  Segaboy 4 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #46152

    ductai
    Member

    Hello everyone,
    I am newbie with MongooseIM. Now I have a task with integrate push notification service to MongooseIM.
    I read documentation about this, try to use the mod_zeropush (https://github.com/ZeroPush/mod_zeropush) for ejabberd 2.1.x (MongooseIM is from 2.1.8, as I remember).
    When adding this module to MongooseIM, i must comment somethings in the mod_zeropush, such as include “logger.hrl”, comment all the INFO_MSG in this module. As I know the INFO_MSG were defined in ejabberd.hrl, so if we still add the logger to this module, it will show the error of “redefining MACRO (PRINT, INFO_MSG,…)”.
    When I comment these commands, I can build it successfully the mod_zeropush.beam. But when I add the mod_zeropush.beam, reconfig the ejabberd.cfg and restart the MongooseIM, it show this kind of error when sending the offline msg:


    [error] <0.540.0>@ejabberd_hooks:run1:338 {undef,[{gen_mod,get_module_opt,[<<"localhost">>,mod_zeropush,sound,#Fun<mod_zeropush.0.85349835>,<<"default">>],[]},{mod_zeropush,send_notice,3,[{file,"src/mod_zeropush.erl"},{line,64}]},{ejabberd_hooks,run1,3,[{file,"src/ejabberd_hooks.erl"},{line,334}]},{ejabberd_sm,route,3,[{file,"src/ejabberd_sm.erl"},{line,108}]},{ejabberd_local,route,3,[{file,"src/ejabberd_local.erl"},{line,139}]},{ejabberd_router,route,3,[{file,"src/ejabberd_router.erl"},{line,78}]},{ejabberd_c2s,session_established2,2,[{file,"src/ejabberd_c2s.erl"},{line,1211}]},{p1_fsm,handle_msg,10,[{file,"src/p1_fsm.erl"},{line,542}]}]}
    Running hook: {offline_message_hook,[{jid,<<"user1">>,<<"localhost">>,<<"Vacuum-IM">>,<<"user1">>,<<"localhost">>,<<"Vacuum-IM">>},{jid,<<"user2">>,<<"localhost">>,<<>>,<<"user2">>,<<"localhost">>,<<>>},{xmlel,<<"message">>,[{<<"xml:lang">>,<<>>},{<<"from">>,<<"user1@localhost/Vacuum-IM">>},{<<"type">>,<<"chat">>},{<<"to">>,<<"user2@localhost">>}],[{xmlcdata,<<"\n">>},{xmlel,<<"body">>,[],[{xmlcdata,<<"test more!">>}]},{xmlcdata,<<”\n”>>},{xmlel,<<”active”>>,[{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],[]},{xmlcdata,<<”\n”>>}]}]}
    Callback: mod_zeropush:send_notice

    Anyone has solution for this?
    I would appreciate a lot.

    #46153

    jveiga
    Member
    #46154

    ductai
    Member

    Hi jveiga,
    The gen_mod:get_module_opt,… all these things I just got from the existing module. So I don’t understand your answer (misuse)
    I think this module (mod_zeropush.erl) already runs normally in ejabberd. So the calling of gen_mod:get_module_opt is normal too.
    Thanks,
    Tai.

    #46522

    ductai
    Member

    Hi all,
    I found the reason for this. That’s my mistake of getting the mod_zeropush for ejabberd 13.10 and run in ejabberd 2.1.x (or MongooseIM).
    Thanks all again,
    Any way I am in process to do push notification in MongooseIM.

    #51777

    Segaboy
    Member

    When adding this module to MongooseIM, i must comment somethings in the mod_zeropush, such as include “logger.hrl”, comment all the INFO_MSG in this module. As I know the INFO_MSG were defined in ejabberd.hrl, so if we still add the logger to this module, it will show the error of “redefining MACRO (PRINT, INFO_MSG,…)”.

    NAT

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.