push notification chinese character

0 votes

Question 1

I using unity to push chinese character, i added 


Dictionary<string,stringotherMetaHeaders = new Dictionary<stringstring>();    otherMetaHeaders["dataEncoding"]= "true";

App42API.BuildPushNotificationService().SetOtherMetaHeaders(otherMetaHeaders);

But it not working, the result i get is "??" for two chinese character.

Question 2

When i try to push chinese character i receive 24 push notification? a single push with multi notification?

 

How can i solve this two problem, i using unity, and target platform is android.

asked Oct 20, 2014 in App42 Cloud API-BaaS by admin (10 points)

1 Answer

0 votes

Hello,

Please find a below code snippet to send multilingual push notification and use the same for sending message:

String userName = "Nick";
String message = "Message which you have to send";
App42Log.SetDebug(true); //Print output in your editor console
PushNotificationService pushNotificationService = App42API.BuildPushNotificationService();
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("dataEncoding", "true");
pushNotificationService.SetOtherMetaHeaders(otherMetaHeaders);
pushNotificationService.SendPushMessageToUser(userName,message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
public void OnSuccess(object response)
{
PushNotification pushNotification = (PushNotification) response;  
App42Log.Console("Message is " + pushNotification.GetMessage());
App42Log.Console("userName is : " + pushNotification.GetUserName());
}
 
public void OnException(Exception e)
{
App42Log.Console("Exception : " + e);
}
}
About your second query, multiple notification comes only when you have registered same device token for multiple user and using send message to all method to send the push notification. Please check and if that is not the case than please share the method logs & App Name with us.  To print the logs, kindly use below line of code and put before calling the send message api.
 
App42Log.SetDebug(true);
 
Thanks 
answered Oct 20, 2014 by hs00105 (2,005 points)
I hope your query has been resolved, kindly let us know if you have more questions for us.
Thanks,
Himanshu Sharma
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
...