Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration With Ejabberd ( Any XMPP Server) #24

Open
karanianandkumar opened this issue Aug 6, 2019 · 2 comments
Open

Integration With Ejabberd ( Any XMPP Server) #24

karanianandkumar opened this issue Aug 6, 2019 · 2 comments

Comments

@karanianandkumar
Copy link

Currently, I am using Ejabberd Server and Smack library on the client-side( Android Application). When TCP connection closed by android platform due to Network changes or services killed by OS, I am trying to reconnect. Reconnection is happening most of the time.

But in recent released android OS, they have added DOZE mode to restrict apps to run in the background when the device is locked. When the device lost connection with Ejabberd server, the user will be treated as offline. Then I am sending FCM notification through Ejbberd offline hook. I created one API service, where inputs will be coming from Ejabberd offline hook. The same inputs passed to FCM REST API. When I receive the FCM notification on the device, I am connecting to Ejabberd server in the background. But Some android devices(Newer devices) not allowing me to connect to the XMPP server in the background.

I would like to know will this library help me to resolve my issue.

I would be thankful for your suggestions and guidance.

@carlosCharz
Copy link
Owner

Hi @karanianandkumar Sorry for the delay. I was making some research because I have not faced that problem before. 1st because we are not using any ejabberd server. Nevertheless I was helping one guy who was doing something similar to you with the python hook. I think you both might face the same problem because it looks like an android limitation.

Look at Q8. It is like yours right?
https://discourse.igniterealtime.org/t/help-with-smack-client/80848

I asked your question to my android dev friend and he said that maybe you can play with the scheduler with a small task in the background. Have you tried that?

Greetings.

@karanianandkumar
Copy link
Author

Thanks, @carlosCharz For sharing resources. Yeah almost similar. But if I use Foreground Service in Android, Notification will be always displayed. Which is not good for Chat Application. I am trying to figure out how Whatsapp or FB handling similar situation.

In Some devices those schedulars also not executed (No internet access to My application even though device has internet) until device is unlocked.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants