[TIMOB-23720] Android - CallBack for push notifications doesn't work when app is open in background
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-12-22T15:41:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, ipass1 |
Reporter | Davide Pecis |
Assignee | Gary Mathews |
Created | 2016-07-30T14:16:19.000+0000 |
Updated | 2018-08-06T17:37:06.000+0000 |
Description
Hello,
I’m having a problem with push notifications in the Android version of the App we are developing.
Specifically, it seems like push notifications work differently if my app has been sent to background using the “back” or “home” button of the phone.
*1) FIRST CASE – background using back button*
When I receive a push notification, I click on it, the App opens and display the right page
*2) SECOND CASE - background using home button*
This time, when I receive a push notification and click on it, the App opens on the last page I was previously viewing, before I sent the app to background.
This is obviously not the right behavior.
It seems like the CallBack function for push notification is not called in this case; we are using Single Call Back.
Now, the interesting thing is that if I open the App again immediately, now the callback works and the first thing I see in the App is the content of the push notification.
---
We are using SingleCallback.
This bug is on Android only; on iOS devices everything is ok.
Our code:
if (isAndroid) {
var CloudPush = require('ti.cloudpush');
CloudPush.setSingleCallback(true);
CloudPush.retrieveDeviceToken({
success: deviceTokenSuccess,
error: deviceTokenError
});
CloudPush.addEventListener('callback', pushCallbackAll);
}
---
I've also made a short video to let you see what happens:
https://youtu.be/hiYwcY3vahY
Why does it happen? Any idea?
Thank you very much for your help,
Kind regards
Davide
Any update about this issue? Thank you for your help, Regards
Sorry to bother you, but more than a month has passed without any answer. Have you been able to reproduce it? Is there any update? If you need more information, please, just ask me. Kind regards Davide
Hello, Has this bug been resolved with the latest releases of Studio 4.8.0 and Titanium 6.0.0? Please, any feedback about it would be highly appreciated. You haven't given a single reply so far... Best Davide
[~Peach1200], I am not able to reproduce the issue with a simple callback like an alert & setSingleCallback true . Can you provide me with a sample with which I can reproduce the issue?
[~Peach1200] I'm curious as to what you are doing inside your
pushCallbackAll()
method? How are you creating the Intent to open the specific page you want?The intent to open the app should use the
Ti.Android.FLAG_ACTIVITY_NEW_TASK
intent. Closing as invalid.Hello @Gary Mathews Sorry for my late reply. I've heard from my developer today about this issue. He told me that we use the following module:
Modules.CloudPush
If I'm not mistaken, we don't have direct access to the intent inside the module. Am I mistaken? How can we eventually check and change the intent used in that module? (sorry for my poor "technical language"; my developer does not speak english and I'm trying to translate what he says to me) Thank you for your help, Best regards DavideClosing as invalid. If incorrect, please reopen.