Push Notification issue
There is some error or bug on push notification; it is not really working properly. After a while it stops sending push, also when re-doing the steps it actually stopped registering the apps. Can you please give some guidance on it
to give more background on the issue:
- Android to Android- when app is completely off the background it's not pushing message notification
- Also noticed that the Device is not being registered but assumption is that it's due to (in BBackendlessHandler.java) : @Override public boolean unsubscribeToPushChannel(String channel) { if (!BNetworkManager.sharedManager().getNetworkAdapter().backendlessEnabled()) return false;
thanks
Hi @Lavii7,
This is caused by differences between iOS and Android and the goOffline function.
For example with iOS there is a function which lets the developer know that the app is in the background. This means that as soon as the app goes to background we remove the observers and turn push notifications on.
With Android there isn't a background feature like this meaning that the user stays online unless the app is closed or the memory deallocates the app and it stays in the background. At this point the user is marked as offline and push notifications will be sent to them.
This issue was raised previously here. If you wanted to download and test the hotfixes branch you could see if this has been fixed and we could then merge this into the main project - I will try in the next week but am quite busy currently.
Finally with registering of device, you only want to register each device once. There are a lot of users who have downloaded the Chat SDK Android and configured the push notifications so I would assume that the current code is correct. If you can get a method for testing it where a device isn't registered and this causes push notifications not to work I can look into it.
It is worth having the Backendless dashboard open in front of you while testing this as you can see registered devices. A device only wants to be registered once so as long as the device appears here then push notifications should be ok.
Simon
Hi @Lavii7, I clicked close and comment by mistake, please ignore this and continue with the above answer, Simon
Hello, I have done what you recommended still same problem; to be clear actaully all was set up as per the instruction and was updated to your hot fix updates; however I tried using the hotfix version still running into the same problem; only thing i noticed is that the way you setup the Google-service.json file is different (if there is a specific way to set it up please advice) This is the error i am running into after following your advice: 04-10 11:12:16.375 23630-23630/com.braunster.androidchatsdk.app E/com.backendless.push.BackendlessPushService: Error processing push message: Could not register device on Backendless server: Version is disabled or provided wrong application info (application id or secret key) 04-10 11:12:26.102 23630-23630/com.braunster.androidchatsdk.app E/com.backendless.push.BackendlessPushService: Error processing push message: Could not register device on Backendless server: Version is disabled or provided wrong application info (application id or secret key) 04-10 11:18:21.164 24817-24817/com.braunster.androidchatsdk.app E/com.backendless.push.BackendlessPushService: Error processing push message: Could not register device on Backendless server: Version is disabled or provided wrong application info (application id or secret key) 04-10 11:21:41.063 24817-24817/com.braunster.androidchatsdk.app W/System.err: at com.braunster.androidchatsdk.firebaseplugin.backendless.BBackendlessHandler.unsubscribeToPushChannel(BBackendlessHandler.java:85) 04-10 11:22:34.305 24817-24817/com.braunster.androidchatsdk.app E/com.backendless.push.BackendlessPushService: Error processing push message: Could not register device on Backendless server: Version is disabled or provided wrong application info (application id or secret key) 04-10 11:23:21.047 2313-2313/? E/SPPClientService: [[PushClientService]] onStartCommand. F:false, D:false, E:true, T:false, S:true, R:false 04-10 11:23:21.664 25870-25870/? E/SPPClientService: ============PushLog. commonIsShipBuild. stop! 04-10 11:23:21.664 25870-25870/? E/SPPClientService: [PushClientApplication] Push log off : This is Ship build version All the Key and app info are correct both in backendless and in app string section please help
Noticed that this issue was also raised @ Backendless(http://support.backendless.com/topic/could-not-register-device-on-backendless-server) : are we suppose to call Backendless.setUrl() along with Backendless.initapp() in all activities? I don't think so right at least for the chat app right? Also, all my permission is same as the one on the most recent branch
Hey ignore my comment about the Google-service.json i was aloe to configure that properly and still having the push problem please help; suggestion-->I would recommend having a guide on the push notification section as it seems like there are multiple open questions related to that, Thanks
Hi @Lavii7,
Putting together a push notification video is on my list of things to do.
I am slightly confused as to what problem you are finding with the push notifications.
Android to Android- when app is completely off the background it's not pushing message notification Also noticed that the Device is not being registered but assumption is that it's due to (in BBackendlessHandler.java):
The first issue is currently how the Chat SDK works. It might be that a fix to this has been pushed to the branch.
The second issue it would be good to have more information on. Are push notifications working? Are they working for a certain amount of time then failing to work? I am a bit confused.
If you can comment with the exact problem you are having with push notifications and how to recreate it then I can look into the problem. Currently this issue seems to have a lot of different issues throughout the thread which makes it difficult to troubleshoot.
Simon
Hey, you have actually summarized issues being faced: MAIN ISSUE- "Android to Android" push is not working everything else works but the push is not working at all (Note- I have the latest brach version- difference is per instruction like the backendless ids etc...) specific log shown when not registering push is below: (All ids are correct and version is not disabled registration is on have checked it multiple times): 04-12 21:12:46.346 20580-20580/com.braunster.androidchatsdk.app V/FA: Registered activity lifecycle callback 04-12 21:13:26.576 20580-20580/com.braunster.androidchatsdk.app E/com.backendless.push.BackendlessPushService: Error processing push message: Could not register device on Backendless server: Version is disabled or provided wrong application info (application id or secret key) OTHER ISSUE: we can take care of them after we finish main issue which is to get Android to Android push notification
This ticket can be closed, was able to figure it out
Hi @Lavii7,
Can you post how you were able to figure out the issue? This will help other developers who face this issue in the future?
Simon
Hey you can close this , sry for late reply
Hi @Lavii7,
We closed this a few weeks ago, if you can post how you fixed the issue to this thread it will help other users who are facing the same problem in the future.
Simon