Problem:
iOS isn\'t receiving any remote notifications from GCM, but can\'t find any information relating to why this would be the case.
First time
The error 2001 you get is NOT kGGLInstanceIDOperationErrorCodeMissingKeyPair
but rather kGCMServiceErrorCodeAlreadyConnected
. The latter means that you're already connected to GCM. To better debug this I would try to send a display notification to the device token i.e. send this
$post_json_encode = '{"notification":{"body":"' . $msg . '"},"to":"/topics/global"}';
You should theoretically connect to GCM when your app is in the foreground and disconnect when you go to background. You can then reconnect again when you come to the foreground.
The data payload
and notification payload
are both applicable on iOS & Android. On iOS the difference is that notification payload is sent through APNS while data payload is sent through GCM's own connection which is only there when app is in foreground. In Android notification payload is the new display notification stuff added recently.