Publish message error in some device! code: Internal client exception

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());
}
});

See the section marked as “IMPORTANT” at:

https://backendless.com/documentation/messaging/android/messaging_sync_and_async_calls.htm

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());

}

@Override
public void handleFault(BackendlessFault backendlessFault) {
    Log.i("Send Error", "=" + backendlessFault.getMessage() + "-code=" + backendlessFault.getCode()
    +"-detil="+backendlessFault.getDetail());
}

});

What is the result? Is there a stack trace? Perhaps an error code?

no just it :
code:internal client exception
message:null
detail:null

Please debug it and see which line of code causes the exception. Let us know what you find.

06-25 00:43:21.979 W/System.err: BackendlessException{ code: ‘Internal client exception’, message: ‘null’ }
06-25 00:43:21.979 W/System.err: at com.backendless.Invoker$SyncResponder.errorHandler(Invoker.java:127)
06-25 00:43:21.979 W/System.err: at com.backendless.core.responder.AdaptingResponder.errorHandler(AdaptingResponder.java:93)
06-25 00:43:21.979 W/System.err: at weborb.client.ioEngine.HttpIOEngine.send(HttpIOEngine.java:213)
06-25 00:43:21.979 W/System.err: at weborb.client.ioEngine.HttpIOEngine.invoke(HttpIOEngine.java:145)
06-25 00:43:21.979 W/System.err: at weborb.client.WeborbClient.invoke(WeborbClient.java:138)
06-25 00:43:21.979 W/System.err: at com.backendless.Invoker.invokeSync(Invoker.java:100)
06-25 00:43:21.979 W/System.err: at com.backendless.Invoker.invokeSync(Invoker.java:112)
06-25 00:43:21.979 W/System.err: at com.backendless.Messaging.publish(Messaging.java:423)
06-25 00:43:21.979 W/System.err: at com.backendless.Messaging.publish(Messaging.java:387)
06-25 00:43:21.979 W/System.err: at com.backendless.Messaging.publish(Messaging.java:366)

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/

Mark