I am trying to send Danish characters (Æ, Ø, Å) in an alarm notification using Easy APNs but when doing so, no message is send. If I send it with sound, only the sound is send. Also the message will be set to “null” in the database if it includes any of the Danish characters.
Does anyone know a fix for this?
This was caused by
json_encode(). Usingutf8_encode()on my alert views beforejson_encode()solved the issue.UPDATE (How to fix the issue)
1. In
class_APNS.phparound line 411, you have$msg = chr(0).pack("n",32).pack('H*',$token).pack("n",strlen($message)).$message;Above that, put:
$message = utf8_encode($message);2. In
class_APNS.php(same file) put this:$usermessage['aps']['alert'] = utf8_encode($usermessage['aps']['alert']);Put it just above the following: