Hi
I’d like to send push notification from my android app.it’s work fine in some device but in some device it receive push very well but can’t publish push and got this error: Internal client exception.
this is my code:
Backendless.initApp(this, “my_applicationId”, “my_secretKey”, appVersion);
Backendless.Messaging.registerDevice(“my_GCM_sender_id”, new AsyncCallback<Void>() { @Override
public void handleResponse(Void arg0) {
new Thread(new Runnable() { @Override
public void run() {
try {
MessageStatus status=Backendless.Messaging.publish(“defult”, “message text”);
}catch (Exception e){
e.printStackTrace();
}
}
}).start(); @Override
public void handleFault(BackendlessFault arg0) {
Log.i(“GCM”, “=”+arg0.getMessage());
}
});
thanks mark.i know about sync and async call and i try all ways.
i said it’s work fine in some device.i think maybe that devices block publish message because other backendless calls work very well.i got this error only when wants to publish message on some device.
You’re using the sync version of Backendless.Messaging.publish. You will get that exception on any device that runs Android for the reason described in the documentation.
i try this too but got same result:
DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.addPushSinglecast(Device_ID);
Backendless.Messaging.publish(“defult”, content, publishOptions, deliveryOptions, new AsyncCallback<MessageStatus>() { @Override
public void handleResponse(MessageStatus messageStatus) {
Log.i(“Send Ok”, “=” + messageStatus.getStatus() + “–” + messageStatus.getErrorMessage());
This tells me that your code still invokes the synchronous version of the method. Here, take a look, line 423 in Messaging.java is right in the sync version of “publish”:
finally i found the problem.
error occurred when both device use of same wifi network.but when network is different both device work very well.
Mark can you solve this problem? it’s very necessary,because my app is an social network and it’s possible people of a family use of app and then they can’t send message on their wifi network.
The problem with “internal client exception” has nothing to do with what network you use. It occurs only if you use sync api on the main UI thread in Android.
We’d be happy to look into the problem in your code. Since this is outside of the free support, you’d need to purchase “single-incident support” as described at: https://backendless.com/support-policy/