CloudKit share private Container between users - ios

I'm planning to develop an App used to share infos about geographic locations (coordinates, notes, pics), a kind of Treasure Hunt and I did not understand if it is possible, using CloudKit, to share part of a private container between users. If it is, how can I do that?
I'd need to create something like Apple does in the Reminders App, where a user can "invite" other users and have a common list to share between them all where everybody can insert or edit stuff.
Eventually if it's not possible to do it using CloudKit, can I do that with Parse?
Thank you!

In iOS 10 / macOS 10.12, it is now possible to share hierarchies of records in a user's private database with other users.
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.

Data in the private container can not be shared directly. You should use a public container for that functionality. You just have to create the right filters in your app so that you only share the data with the people you want to share the data with.

Related

Using the Swift Contacts Framework

When the app has access to the devices contacts, and you need those contacts to populate a PickerView, does it pull the contacts to a Firebase DB and fetch those contacts to populate the PickerView? Or does it do it within the phone(maybe Core Data)?
Any advice or guidance would be greatly appreciated.
If does and I can use Core Data, can I use it hand in hand with Firebase, or does it even store it somewhere? I'd like my users to be able to select which contacts they want to add to the app.
Thank you in advance.
I think it would be best to pull from the device's Contacts, using the Contacts Framework - in Xcode this is the Contacts.framework package. The Apple site offers some sample code that you might be able to take advantage of in your application. For that you'd need permission from the user by enabling a NSContactsUsageDescription in your info.plist. That describes to the user why you'd need access to their contacts.
As far as storing the data in a Database, I'm not sure that would be a wise decision nor one that makes sense. Consider the reasoning behind that, does this information need to be on some remote database? if your answer is no, then chances are that you don't need to do that extra work. You might however register new users that use your application with something like Google's Firebase if you want to manage any messages between users (for a chat app for example).
Hopefully that answers your question and helps you out in some way.

Is it possible write the data in widget to the main app Coredata without group?

I found a lot of solution online, and many of them need to add the project into a group. But i do not own a developer account, i just a student, and i just want to make a widget and the user can interactive by using the button, and add to coredata in the main app, so is it any solution can help me? thanks
No, it's not possible. Extensions on iOS are separate processes from their apps. Sandboxing means that they can't access each other's data unless they use an app group. It's not just Core Data that has this rule, it's any kind of file access. If you won't set up an app group, you might try using a web service to store the data online. Both the app and the extension could use the same web service to share data.

Share task list between people using iCloud

I'd like to create an iOS app for shopping lists (yeah, one more), allowing synchronization between 2 (or more) iCloud users (like what Apple does with shared calendars).
Any idea how I should structure my data to accomplish that ? Can I do that with the tools iCloud offers at the moment in iOS 8?
EDIT: I'm especially interested in the sharing part of the process: how to "invite" other users (as in the Calendar app to "Add Person" for a shared calendar), or maybe include Family members (as declared in iTunes) in
the app.
Thanks
iCloud app data is sandboxed and not accessible by other users https://developer.apple.com/library/ios/documentation/General/Conceptual/iCloudDesignGuide/Chapters/iCloudFundametals.html
In CloudKit there is a private and a public database. when you write to the public database, then that data could be read by others. https://developer.apple.com/icloud/documentation/cloudkit-storage/
Cloud Kit may be your best option

Share data across multiple apps on iOS

I know there are quite a few threads on this, but it seems none of them would satisfy what I am trying to look for. Here's my constraints:
not a hack that uses private API/framework or undocumented
directory access that would run the risk of app being rejected
because of that
being able to share data across different
vendors / app developers
data can persist outside the lifecycle
of the app (even after app is deleted)
UPDATED: I was in general trying to stay away from using a 3rd party cloud-based service to achieve the goal as this would introduce additional external dependency. But if I have to, I was hoping it could satisfy this one constraint
being able to tell which iOS device it is communicating with. It shouldn't have to uniquely identify the device (which will go into that evil UDID discussion route as we all experienced ). But as long as it can differentiate among different iOS devices it should be fine.
I kind of need this too. I use Parse.com as the backend of all my apps — their free tier should satisfy your development needs.
Parse has APIs available for iOS, Android, Windows 8, OS X, JavaScript and .NET, with all your data available on the cloud on any platform (contrary to Core Data and iCloud). They also offer "Cloud Code," which is code you can execute remotely, to process information remotely and get the data back to your app.
You should definitely check Parse.com out for cloud storage for your app. In my experience, it really gets the job done.
For Data Persistence, I think you might want to take a look at FMDB (although if you decide to persist data locally, it will get deleted with your app, but it might help you, anyways). Core Data is an overkill in many cases.
Edit: Parse.com has an "Installation" class, in which all the devices that have your app installed get listed (wether they're running iOS or Android), uniquely, without you having to type any code.
Maybe this blog post by TextExpander authors will help:
Smile has responded to this by discussing the issue with Apple
engineers at WWDC, filing a bug (#14168862), and checking up on the
status of that bug. We also developed a workaround by storing the
TextExpander data in a new place. Reminders requires user consent to
store and retrieve data. Completed reminders are not normally shown in
its interface. Long-past reminders appear at the bottom of the
completed reminders.
TextExpander touch 2.1 (and later) supports storing shared snippet
data in a long-past, completed reminder. We produced an updated SDK
and kept our developers posted on its progress. Our final SDK was
ready within a few hours of the end of Apple's official iOS 7
announcement.
UPDATE (22.11.2013)
This might not be the best way to do that, because TextExpander's team recently had problems with the App Review Team.
Edit: this only works for apps with the same vendor.
You can save a password to the device's keychain, then access that password from any app.
Using the SSKeychain library...
NSString *service = #"com.yourcompany.yourservice";
// read
NSString *password = [SSKeychain passwordForService:service account:#"user"];
// write
[SSKeychain setPassword:password forService:service account:#"user"];
The password string doesn't have a length limit, so encode all your data as a string and save it there. The keychain entry will persist after the user deletes the app.
One of the ways to do this is using THRIFT. This is a data communication protocol that would need a back end server (private) and THRIFT can be compiled into many languages / platforms. There is a meta language to describe the data and then can be thrift compiled into many languages. Write the data definition once and can be used on many platforms.
More information at.
http://thrift.apache.org/
for me (I have 2 apps and a widged) the best solution is using SSKeyChain and do not forget to add Capabilities for your apps like here
or if you don't wanna to use 3rd party library you can use NSUserDefaults and set the group identifier like here but again do not forget to add the group identifier in Capabilities in AppGroups section for all your apps that have share data.

iCloud public data possibility

I am developing a iOS/OS X application with a very "nice to have" feature: possibility to sync with non-iCloud clouds.(through web server in example).
The app design already is completely based on iCloud so I was thinking there might be a workaround I could use instead of writing code for one more data marshaling.
Basically what I need is to make some iCloud stored data available to the public OR get user's e-mail/password used for iCloud on iOS/OS X.
The reason why I need it - I'll have to sync data with another cloud and I want to keeps the app lightweight and so move everything to the server (I think I might need OS X server).
Anyways, any suggestion are appreciated a lot!
I can understand wanting to do that, but just because you want to do it doesn't mean that you can.
Basically what I need is to make some iCloud stored data available to the public
I don't believe that there's a way to do that. iCloud isn't a generalized internet hosting service; it's a service designed to make it easy for an individual user to share his/her private information among several devices. Creating the possibility of making information public would only undermine the trust that people put in the service.
OR get user's e-mail/password used for iCloud on iOS/OS X.
That'd put your users in direct violation of the iCloud TOS, which state in part:
You further acknowledge and agree that the Service is designed and
intended for personal use on an individual basis and you should not
share your Account and/or password details with another individual.
If you want users to be able to sync their data with other hosting services and you don't want to build that functionality into your mobile app, you might consider building a MacOS X app that the user could run to sync the data.

Resources