Open AnD010 opened 4 years ago
Halo @AnD010
I just got the same error, and I managed to solve the error by stopping everything from the pusher.
So the code to run before re-running PushNotifications.start() and setUserId() is:
PushNotifications.stop()
PushNotifications.clearAllState()
I hope this helps, maybe someone else is experiencing the same error. Thank you.
I think the issue is that the documentation doesn't explain well what these methods are intend for.
But in short, Using stop
before clearAllState
doesn't do anything in reality, Just because clearAllState
is just calling stop
and then start
(This is from source code).
fun clearAllState() {
stop()
start()
}
Best way to avoid the problem is just by calling stop
when the user sign out and maybe optionally call clearAllState
in the start to prevent calling the methods twice.
version pusher = "2.2.1" version pusherNotifications = "1.6.2" Hi, I don´t understand this error... It only happens when I close session and call to
Then when go to my first Activity the app crash with the error Pusher error Start method must be called before setUserId pusher. But as you can see in my below code I call PushNotifications.start() first. When the apps crash and open again, all works fine My code
onCreate(savedInstanceState: Bundle?) {initPusher() } initPusher is this code
What is the problem? PushNotifications.start() is asynchronous method???