Using CloudKit from a Today Widget

Hi


I've got an app which uses a custom container (which happens to be the bundle ID of the main app). I have successfully been able to use Cloudkit from the main app and have push notifications (via subscription) working across the apps.


I would now like the Today Widget Extension to use CloudKit too. I have specified the custom container for it to be used but when I launch the widget, I get this:



Error fetching subscription justSynced: <CKError 0x17e82a10: "Permission Failure" (10/2007); server message = "com.company.App.TodayWidget is not a valid Bundle ID for container iCloud.company.App"; uuid = 1F4E96E1-7644-4D97-9EF3-8568E00537F5; container ID = "iCloud.company.App">


I don't get it. I thought apps from the same developer could use a specific custom container? What do I have to do to make this work?

Okay solved it - I created yet another custom container (that does not match the main app's bundle ID) and that worked. It seems if I use a 'default' container ID, widgets aren't then allowed to connect eventhough they've been marked to use the same container.

Weird, but the error description suggests that you have not enabled access to that iCloud container for your widget App ID in the member center. Could you double check?

How to use CloudKit from a Today Widget? I want to write data to CloudKit.

Using CloudKit from a Today Widget
 
 
Q