Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Share data between different users

I'm super confused with this, please forgive me if it has been answered elsewhere. I'm very new to iOS and would like to create a simple shopping list app. User A should be able to create a shopping list which can be shared privately with user B. Once shared, user B should be able not only to view A's list but also modify it. Any changes B makes should be reflected in A's list as well.

Does Apple's Cloudkit provide such functionality? I've also read a few things about BaaS, PaaS etc but can't figure out if they are what I need. Any help will be greatly appreciated. Thank you

like image 948
linuxfever Avatar asked Feb 01 '16 08:02

linuxfever


People also ask

Can iOS apps share data?

App GroupsUse a shared app group to share data/files between two/more apps or containing apps. An app group creates a secure container that multiple processes can access. Normally, each process runs in its own sandbox environment, but an app group lets both processes share a common directory.

Why can't I share health data on iPhone?

Make sure Health is turned on in your iCloud account. Search for a contact to share with. A name in blue indicates that the other person's device supports sharing. Grey means their device does not support sharing.

What is Share extension in iOS?

Share Extension is an easy way that Apple provides to share contents (images, audio, files, etc.) from one app to another, even made by different developers.


2 Answers

In iOS 10 / macOS 10.12, it is now possible to share hierarchies of records in a user's private database with other users (with configurable read/write permissions).

An Overview: [WWDC 2016] Session 226 - What's New with CloudKit

If you want to start diving into the new documentation, check out:

  • CKShare

  • CKShareParticipant

  • CKFetchShareParticipantsOperation

  • CKFetchShareMetadataOperation

  • CKAcceptSharesOperation

And this thread in the Apple Developer Forums, which provides some example code.

like image 181
breakingobstacles Avatar answered Sep 22 '22 18:09

breakingobstacles


Yes, CloudKit can provide the service you need. Your app can store data in private and public databases. You can control the data in the public database so that your users can access only the parts shared by a particular user. CloudKit will require that users allow the service to share their identity with other users. However, I expect that you could share data with revealing identity inside CloudKit by exchanging a key value.

like image 30
john elemans Avatar answered Sep 19 '22 18:09

john elemans