Search code examples
cloudkit

How to work out the Aps payload from CloudKit subscription


As far as my understanding goes, APS is the payload that is sent by APNS to the devices.

I'm using iCloud/Cloudkit as the backend for my app. I have a few Record Zone Subscriptions and Query Subscriptions.

The question is: how do I inspect/debug the actual APS payload on my dev machine? First problem being simulator ignores the notification.

Assuming I have to setup an http proxy, how would I set one up for a real device?

Would it be easiest to just to approximate the Aps payload from the config of my CKSubscriptions?


Solution

  • I use Charlesproxy for debugging requests and response from my device.Just install http://www.charlesproxy.com and enable the proxy. Then on your iPhone, go to your WiFi settings and set the http-proxy to manual and configure it to the ip of your Mac. You can then see all requests and response from your device. You can filter that and even add debug breakpoints. See the Charlesproxy documentation for this.

    But besides that, you will just receive the notifications in you application didReceiveRemoteNotification. the notification will be of type CKQueryNotification. Your data will be a