I currently have:
$payload = array();
$payload['aps']['badge'] = 1;
$payload['aps']['alert'] = html_entity_decode($title);
$payload['aps']['sound'] = "default";
But:
The maximum size allowed for a notification payload is 256 bytes;
Apple Push Notification Service refuses any notification that exceeds
this limit.
$title (is mainly english, not many special chars) is quite often larger than 256 chars. What should I do to check and limit/remove extra chars? strlen?
You can either check with strlen if the title is bigger than 256, or just cut it.
$title = substr($title, 0, 256);