Send Push Fail depends on text

0 votes
Version : 2.6

Hello,

I develop a program to send push notification in Java, but I have a problem if I send this text "Questa è una prova" notification start correctly.

If I send the text "Questa è una prova" I get an exception : {"app42Fault":{"httpErrorCode":401,"appErrorCode":1401,"message":"UnAuthorized Access","details":"Client is not authorized"}}

I make a lot of test and if i write chararacts like "è,ì,à" in the message text I get the excption Client is not authorized, but this only with java, with PHP all work fine.

This is the code:

//userList is a ArrayList of String
//msgJS is the text of message like {"idmsg":"11253","badge":1,"alert":"Questa è una prova","sound":"default","sendingFrom":"serverSide","title":"OpenDartFics"}

PushNotificationService pushService = App42API.buildPushNotificationService();
HashMap<String, String> otherMetaHeaders = new HashMap<>();  
otherMetaHeaders.put("dataEncoding", "true");  
pushService.setOtherMetaHeaders(otherMetaHeaders);  
pushService.sendPushMessageToGroup(msgJS, userList);

 

asked Aug 25 in Java by odf (37 points)

1 Answer

0 votes
Hi,

Apologies for late reply.

Team is looking into it and will update you asap.

Thanks.
answered Aug 28 by rajeev.etc (1,498 points)
Hello,
Greeting!!!
We have tested it at our end, everything is working fine here. Could you please share your sample project with us on (support@shephertz.com)? so we can test the same at our end.
It will help us to provide better support to you from our end.
Hello, did you find a solution ?
Hello,

Please refer our previous comment, everything is working fine at our end. We were unable to reproduce these issue. Could you please share your sample project with us on (support@shephertz.com)? so we can test the same at our end.
It will help us to provide better support to you.

Regards,
Priyanka Singh
App42 Team
Hello,
I build a small project (java command line program) with only code I post above, and work fine.
If I put the same code in a tomcat servlet, when I call the function with the code above di NOT work and get "Client is not authorized" error.
I don't understand the difference, in the tomcat servlet I have more libraries.
How I can send you the project is a Netbeans project, I can send the war file but is about 50MB size
Best regards
Hello,
I develop a small tomcat servlet, and I try on my develop PC (Windows 8.1, 64bit, Java 1.8.144, tomcat 8) and in my PC do not work and get the "Client is not authorized" error..
I load it on the production server (Linux Ubuntu 16.04 64bit, Java 1.8.144, Tomcat 8) and here work and push notification start correctly. I also work on a PC with linux. I all my windows PC do not work, I don't understat what change, the same Java same tomcat but result different and only problems when I use chars like "è".
I Try to check locale, but java report same locale. I don't understand what is the difference, If you want I can send you the source that I use.
Best regards
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
Migrate from Parse to ShepHertz App42
...