Cannot send Chinese characters notification

0 votes
Hi sir,
 
I need to send Chinese character notifications on my IOS device.  I've tried the following block of code:
 
    @try
    {
        NSMutableDictionary *pushDictionary = [NSMutableDictionary dictionary];
        [pushDictionary setObject:@"你好" forKey:@"alert"];
        [pushDictionary setObject:@"default" forKey:@"sound"];
        [pushDictionary setObject:@"2" forKey:@"badge"];
 
        PushNotificationService *pushObj=[App42API buildPushService];
        NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"true", @"dataEncoding", nil];
        [pushObj setOtherMetaHeaders:dict];
        [pushObj sendPushMessageToChannel:pushChannel withMessageDictionary:pushDictionary];
//        [pushObj release];
    }
    @catch (App42Exception *exception)
    {
        NSLog(@"Reason = %@",exception.reason);
    }
    @finally
    {
    }
 
But still give me this error:
 and it does not work.  It still gives me this error message: {"app42Fault":{"httpErrorCode":401,"appErrorCode":1401,"message":"UnAuthorized Access","details":"Client is not authorized"}}
 
Note:  If the "alert" is in English, it can be sent out without problem.
 
Kindly please advise, many thanks!
 
Daryl
related to an answer for: Push Notification Service in non-English
asked Jun 15, 2014 in App42 Cloud API-BaaS by darylng1009 (15 points)

1 Answer

0 votes
 
Best answer

Hi,

I guess you are using older version of the SDK. You can download the latest version(V_2.7) from our github repo.

Thanks.

answered Jun 15, 2014 by rajeev.etc (1,660 points)
selected Jun 17, 2014 by darylng1009
Thanks, output console shows that message is successfully sent after installing V2.7 framework. However, without showing any error messages, all my IOS do not any receive any notification sent from either ShepHertz portol or my IOS device.  Need help here, please give me hits.  I even tried resetting API keys and SECRET keys ... etc.;(
Thanks!
Hi ,
Can you check the Push Logs under Push Notification section in AppHQ Management Console. If something is wrong with iOS server than it will logged there.
Thanks.
Hi,
very strange!  It is all empty!!!
Thx
Hi,
Is your replay attack on App is Disable or Enable.
Thanks
By the way, forgot to say, I reset everything (including the log area) after installing V2.7.  But it is not logging anything since then.
Hi,
It is disabled, I did not touch it at all.  Should I enable it?  What is it for?
Thx!
Hi,
Can you share the logs while you are sending the message to iOS device it will help me to better understand.
Thanks.
Of course, here it is:
App42Trace: -[App42Service populateSignParams].....IN
App42Trace: -[App42Service populateSignParams].....OUT
App42Trace: -[App42Service populateMetaHeaderParams].....IN
App42Trace: InstallationId=0f607264fc6318a92b9e13c65db7cd3c
App42Trace: -[App42Service populateMetaHeaderParams].....OUT
App42Trace: MetaHeaders={
    SDKName = iOS;
    dataEncoding = true;
    deviceId = 0f607264fc6318a92b9e13c65db7cd3c;
}
App42Trace: urlString=https://api.shephertz.com/cloud/1.0/push/sendPushMessageToChannel/CH-0001-001-S?
App42Trace: headerParams={
    SDKName = iOS;
    apiKey = 97b267672d457ea7e612cb74a2c6c2682e3c21ab6035fa737a577c198bbddb87;
    dataEncoding = true;
    deviceId = 0f607264fc6318a92b9e13c65db7cd3c;
    signature = "K5627MeJ1SThLzNcHa%2BFPUCuURM%3D";
    timeStamp = "2014-06-15T17:41:35.578Z";
    version = "1.0";
}
App42Trace: queryParams={
}
App42Trace: Response String : {"app42":{"response":{"success":true,"push":{"message":"eyJiYWRnZSI6IjIiLCJzb3VuZCI6ImRlZmF1bHQiLCJhbGVydCI6IuS9oOWlvSJ9","channels":{"channel":{"channelName":"CH-0001-001-S"}}}}}}

However, even ShepHertz portal cannot send out notification now!!!

Thx!
We are looking into it and get back to you soon.
Thanks.
Hi,
Push services are operating normally now. Please check your Push logs for any error messages in case push is not getting delivered.
Thanks.
Hi, Thanks!  You mean there was service interruption in the past hours?  No wonder!  However, was bad luck that I just changed the framework version and some codes.  Thought that it my code's problem.  But also like to know, why did this happen and how often it happens?
Thanks!
Darylng, I hope upgrading your SDK sorted out your Chinese characters problem. Yesterday there was delay in Push Notification Server due to heavy traffic for some time. This has been sorted out and more servers are added. We do not expect this thing to happen again even for 40X traffic.
Thanks.
Thanks.  Hope this delay issue can be avoided in the future.  One thing now is very interesting, when I send one notification to one of my IOS device (from ShepHertz portal), my IOS device will receive around 3 to 5 previous notifications every time.  I've deleted the subscription and resubscribed it again but problem persist, please advise how to fix it.  
Thanks again.
There may be a case that multiple users are registered with same deviceToken and all are subscribed to the channel. Then if you call "sendPushMessageToChannel" it will send push to all users subscribed to the channel.
As deviceToken is same for multiple users then same device will receive N number of push if it is registered with N number of users.

That you can check on AppHQ Dashboard under PushNotification-> Users.

Thanks.
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
...