Send Push Fail depends on text

0 votes

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, 2017 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, 2017 by rajeev.etc (1,660 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
Hello,

Apologies for the delayed response.

Please download the push sample from this link( http://cdn.shephertz.com/repository/files/4b65291e77f0779c41c51df028768c3015af7380271d068270a531c594b15706/eed118b08401526bc9d83ab7ede7306b38599c1b/PushSampleApp.zip ) and follow the below steps:

1. Download and import the java project
2. Replace the security credential and user names to whom message to be send
3. Make sure your import project setting is UTF-8 enabled
4. Run main method

If you have any other queries please let us know.

We will be happy to help you!

Regards,
Priyanka Singh
App42 Team
Hello,

Your example send message correctly, my application on my development pc (Windows PC )
continue to give me the errror. Tomorrow I will test with linux development PC
Best regards
Hello,

Greetings!!!

In case if you are facing any issues after the test this sample at your end please do feel free to reach out to us.

We will be happy to help you!

Regards,
Priyanka Singh
App42 Team
Hello,
your example do not work on my development pc in windows, but work on linux development pc, same tomcat version, same java version. I don't understant where is the problem.same software, same libraries, only the operating system is different. Is very strange.
There is something I can do to understand the problem.
Hello,

Greetings!!!

We have forwarded your query to our team, we will be getting back to you as soon as possible.

Meanwhile, if you have any other queries please do feel free to reach out to us.

We will be happy to help you!

Regards,
Priyanka Singh
App42 Team
Hello,

Could you please make sure that UTF-8 setting is enabled in case of Windows PC? Please check and let us know If you are still facing these issues.

We will be happy to help you!

Regards,
Priyanka Singh
App42 Team
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
...