Hello,
I get often this error when I send push notification from my java client desktop application:
13:56:02,687 ERROR App42SendPush:107 - Errore app42:{"app42Fault":{"httpErrorCode":401,"appErrorCode":1401,"message":"UnAuthorized Access","details":"Client is not authorized"}}
com.shephertz.app42.paas.sdk.java.App42SecurityException: {"app42Fault":{"httpErrorCode":401,"appErrorCode":1401,"message":"UnAuthorized Access","details":"Client is not authorized"}}
at com.shephertz.app42.paas.sdk.java.connection.RESTConnectorAsync.handleException(RESTConnectorAsync.java:311)
at com.shephertz.app42.paas.sdk.java.connection.RESTConnectorAsync.executePost(RESTConnectorAsync.java:135)
at com.shephertz.app42.paas.sdk.java.push.PushNotificationService.sendPushMessageToUser(PushNotificationService.java:674)
This is the code that I use:
try {
PushNotificationService pushNotificationService = App42API.buildPushNotificationService();
PushNotification pushNotification = pushNotificationService.sendPushMessageToUser(userCode, message);
ret = 1;
} catch (App42Exception exception) {
logger.error("Errore app42:" + exception.getMessage(), exception);
int appErrorCode = exception.getAppErrorCode();
int httpErrorCode = exception.getHttpErrorCode();
ret = -1;
}
What is wrong ?
Best regards.