Closed hannta closed 6 years ago
Make sure not to use the notification attribute when sending a notification through FCM. Always use data.
@hannta Provide your app flow because i got same error and solved it.
I have the app with login window so when i install the app first time and after logged in, i closed the login window and open next window that time when i clicked on notification i got same error and even callback function is not being called too.
So what i did is, instead of closing the login window, i hide it. That solves my issue.
@progress44 I still have one issue. Notification is not received when app is closed. All other aspects work well.
Hello There,
First of all thanks for this great module, I really depend on it for several projects.
I have only one concern, is this issue, where the app is totally closed and notification is received, the user will click on that notification, but this module doesn't fire the callback.
If you want you can benefit from this module, https://github.com/arleyandrada/PushClient, which works fine with these scenarios.
The following is the snippet of code that I used in index.js in Alloy Project:
(function(){ var TiGoosh=require('ti.goosh'); TiGoosh.registerForPushNotifications({ callback: function (e) { alert('{message}'); var data = JSON.parse(e.data || ''); if (data.recipeId != -1 && e.inBackground) { Alloy.createController('/recipeDetails', { id: data.recipeId }).getView().open(); } }, success: function (e) { console.log('Notifications: device token is ' + e.deviceToken); Titanium.App.Properties.setString("token", e.deviceToken); }, error: function (err) { console.log(err); } }); })();
Kindly, I'm waiting for your replay to check if this can be resolved soon, or I should work on another solution until this is fixed.
Thanks again.
While we're working on a solution for this issue, one possible way to avoid this is to check with the server for unopened notifications.
This should provide a temporary fix
@progress44 any status update yet?
The issue is still open. Try the solution above
@progress44 thnx for your reply. for now i used the PushClient module @malhajj suggested. It works great in all cases. Hope you can solve the problems in ti.goosh.
Any fix yet? i'm getting the same error using ti.goosh 4.0.0 with TiSDK 7.0.1
Hey guys, issue solved :) https://github.com/caffeinalab/ti.goosh/commit/22924ee861ae3e05f6fb2b2710db34521f0a8d4e
I've just tested it (4.1.0) and everything works like a charm wether the app is opened, in background, closed or killed, thanks a lot @kopiro
But I did find the bug where if click the notification i get the popup "Restart Required" infinite times,
luckily i already encountered this bug back in 2015 the solution is to add the following to tiapp.xml
<property name="ti.android.bug2373.finishfalseroot" type="bool">true</property>
And everything is in order :)
HI @Sofianio, did you get this error on every device and every time your clicked on the tray?
@kopiro Here are my test results:
Galaxy S5 (Android6): it happens every time i click on the tray, and i get the popup infinite times
Wiko U Feel Lite (Android6): it happens every time i click on the tray, but i get the popup once and the app never opens
Galaxy S6 (Android7): the bug didn't happen, everything works fine
I hope this helps.
When my app is completely closed and I click the notification, I get the "No valid root or current activity found for application instance"
Im using ti.goosh 2.0.6 and TiSDK 6.0.4. I have also tried to compile my app using TiSDK 6.0.1, but still getting the same error.
There is similar (closed) issue #47 but with no actual solution, other than using TiSDK 6.0.4?