Android firebase push notifications are not delivered after coming to online from offline when we use rest api php

Mobile Technologies Mobile Computing 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I have followed the below tutorial for firebase push notification in android using php rest api https://www.simplifiedcoding.net/android-push-notification-tutorial-using-firebase/ I can able to receive push notification only when the registered device is online.. when its offline at time of sending push notification if the registered device is offline and if it comes online later, those notifications are not getting received.. When we send push notification even though device offline firebase response tells that its successfully delivered.. {"multicast_id":8938362209686545843,"success":3,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1493758633066681%9383da03f9fd7ecd"},{"message_id":"0:1493758633067106%9383da03f9fd7ecd"},{"message_id":"0:1493758633066683%9383da03f9fd7ecd"}]}[] Do I need to do anything more for offline feature other than the above tutorial? Tried adding FirebaseDatabase.getInstance().setPersistenceEnabled(true); in the multidexapplication class, but still not working. Thanks in advance

Posted on 16 Aug 2022, this text provides information on Mobile Computing related to Mobile Technologies. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ Its working as i have added FirebaseDatabase.getInstance().setPersistenceEnabled(true); in my multidexapplication class.. At the time of adding it I couldn't see the result. But later on I could find the notifications were being delivered once device came online.. I hope this single line of code FirebaseDatabase.getInstance().setPersistenceEnabled(true); done the job. Thanks

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Mobile Technologies Links

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community