How to configure Push mode configuration in XMPP with FCM refresh token using smack in android?

こ雲淡風輕ζ 提交于 2020-03-16 05:46:32

问题


Currently i'm using smack library for XMPP configuration and I want to do XMPP connection of Ejabberd to firebase by send RefreshToken to XMPP.

I need to close connection when application is in background or kill and receive notification from Firebase but how can i send refresh token and other param as below using smack library?

At the start of each session the user must register to a push mechanism. Depending on the chosen mechanism, several parameters can be passed. The push configuration packet could be something like:

<iq type='set' id='123'>
 <push xmlns='p1:push'>
 <keepalive max="30"/>
 <session duration="60"/>
 <body send="all" groupchat="true" from="jid"/>
 <status type="xa">Text Message when in push mode</status>
 <offline>false</offline>
 <notification>
 <type>applepush</type>
 <id>DeviceToken</id>
 </notification>
 <appid>application1</appid>
 </push>
</iq>

How can i configured XMPP connection using smack library.

来源:https://stackoverflow.com/questions/41627599/how-to-configure-push-mode-configuration-in-xmpp-with-fcm-refresh-token-using-sm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!