Sharing CKAssets between users with CloudKit?

171 Views Asked by At

I want to allow my users to upload an image that they can share with other users. This could either go in their private or public storage, but in either case would need to be accessible via a URL. I'm wondering if this is possible, first and foremost.

Additionally, I'm aware that you can query for any file shared publicly, as the developer. I wonder if that would compromise my security - whether it'd be possible for a 3rd party to pose as myself and then run a query to gather up the data of other users.

EDIT: It seems this may be possible with cloudkit web services. As this isn't a native API, but instead a web call, would it be available for production apps before the release of iOS 9?

https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/RereferenceAssets/RereferenceAssets.html#//apple_ref/doc/uid/TP40015240-CH9-SW1

1

There are 1 best solutions below

0
On

You can share CKAssets with any other CKRecord with whoever you want. Only an app that is signed with your developer account will be able to access the CloudKit container. In theory this could only be broken by someone on a jailbroken device by injecting code into your app. But then again, that will be valid for every solution you choose.

If you want to see a sample of how a foto can be shared with someone, then have a look at EVCloudKitDao. In the demo app you can start a chat with anyone and share a picture.