Hello,
I have develop a script in Php for sending push notifications.
The app is developed for IOS, Android and WP8 / WP81
I need to use quotes and double quotes in the message
I use this syntax:
App42API::setLoggedInUser("xxxx");
$pushNotificationService = App42API::buildPushNotificationService();
$title="my app title";
$msg = 'This is a "Test" ';
if (preg_match('/"/', $msg)>0){
$tmp = addslashes($msg);
$msg = $tmp;
}
$msgJs = "{'alert':'$msg','title':'$title','badge':1,'sound':'default','sendingFrom':'serverSide'}";
$messageAfterAddSlahes = addslashes($msgJs);
$pushNotification = $pushNotificationService->sendPushMessageToUser($user, $messageAfterAddSlahes );
This notification was received correctly on IOs and Android, but un windows phone do not arrive.
In the pushlog in the management console i receive this error message : WP7Message Exception While Sending or Deleting records : org.json.JSONException: Expected a ',' or '}' at character 31
This only for Windows Phone
Can you help me ?