Closed rborn closed 7 years ago
Can you reproduce the issue on current Pushwoosh Sample? Could you also specify Android NDK version you are using?
it seems that the crash happens because on the second start the app tries to send success multiple times.
I was not able to reproduce this behaviour with multiple successful registration callbacks. Also changing PushnotificationsModule.checkMessage()
to invoke successCallback
multiple times does not make this issue appear. So I do not think it is directly connected to this problem.
As I see from stacktrace, this issue occurs in native bindings for getPushToken
. Please check if the problem persists after removing all usages of this method.
Hi, thank you for your fast reply.
getPushToken
and getNotificationSettings
calls indeed fixes the problem (but I still need them)And the success signal is sent twice on the second start (after the app is closed with back button)
@Kroll.method
public String getPushToken()
{
String token = null;
try
{
token = PushManager.getPushToken(TiApplication.getInstance().getRootActivity());
}
catch (Exception e)
{
}
return token;
}
Any idea? Thank you!
I can reproduce the issue with the sample app by adding the next code in alloy.js
var pushwoosh = require('com.pushwoosh.module');
pushwoosh.getNotificationSettings();
pushwoosh.getPushToken();
Putting this code in alloy.js
does indeed reproduce the problem. I suppose it is connected to Titanium initialization process. It is simply not ready to execute module methods at this point after restart (I wonder why).
As a workaround you cat put this code in index.js or wrap it with setTimeout:
setTimeout(function() {
var pushwoosh = require('com.pushwoosh.module');
pushwoosh.getPushToken();
pushwoosh.getNotificationSettings();
}, 0);
Modifying kroll java method in pushwoosh module does not change anything because execution does not even reach this point. It crashes in native bindings that are automatically generated by Ti build system (android/build/generated/jni/com.pushwoosh.module.PushnotificationsModule.cpp).
Ok, I will try and let you know. Thank you.
Ok, moving away from alloy the pushwoosh code seems to fix the crash. Now to adjust the logic to do what was doing before 😟
Thank you, I'll close the ticket.
Hi, I'm using the last version of the module, and Ti.SDK 6.0.3.
How to reproduce:
I tried to have a look at the module's code and it seems that the crash happens because on the second start the app tries to send success multiple times.
This is important for us, we have lot of complains from the users, so could you please have a look? Thank you!
Crash log: