Can a Mac OSX app access CloudKit without being on the Mac App Store? - cloudkit

Being on the Mac App Store is a requirement to access iCloud.
Will the same apply to accessing CloudKit?
The scenario is to have an Mac OSX application share data with an iOS counterpart via CloudKit.
According to this article - http://9to5mac.com/2014/06/05/icloud-drive-enables-non-mac-app-store-apps-to-use-icloud-document-storage/ - you do not but I'm seeking confirmation from any developer who has actually managed to do it.

This changed for Mac apps according to this WWDC video (see at minute 6:00):
https://developer.apple.com/videos/play/wwdc2016/226/?time=359
It's now available outside of the mac app store.

The article that you link to does not relate to CloudKit, and in fact does not even mention CloudKit. CloudKit is not iCloud.
What the article says (which is probably true) is that apps distributed outside the app store can access iCloud Drive. This is a new feature yet to be officially released which will apparently be something like Dropbox. Apps will probably be able to read/write files in iCloud Drive just like in any other folder on a Mac.
CloudKit is an entirely separate system with a web service-style API for reading and writing structured data using Apple's servers. It's not available to apps outside of the app store, because those APIs won't work unless the app has the appropriate capabilities via Apple's app provisioning process.

Since CloudKit is released in iOS 8 now, the question itself is valid though.
Quoting from the documentation:
CloudKit is an app service available only to apps distributed through the App Store and Mac App Store

Related

iOS: How to share documents between iPad & iPhone versions of app?

I was under the impression that when Apple rolled out universal apps, that a sharing mechanism was provided to sync files between the same app installed on more than one device. However I don't see much evidence of this. What am I missing?
(Note I would prefer to avoid iCloud, because of privacy concerns about Apple giving users' data to the govt since that is a legal gray area etc.)
You'll need to use a cloud service, such as iCloud to store your shared data. There is no sharing mechanism with a Universal App to share data between devices. The Universal App just lets the same App work on both iPad and iPhone. This is a nice bonus to the customer, because if they have both devices, they only pay for the App once.
The App will need to go get the data from the users storage. If you don't want to use iCloud, you can develop your own, by using storage services from Amazon Web Services, or Microsoft Windows Azure, however, you are stuck with paying for the bandwidth and storage on those services. You're also getting yourself into more work as you'll have to come up with the server side support, and web services yourself. Plus, on the mobile device, you'll need to concern yourself with handling losing a network connection, caching the data on the device, and then sending it when connectivity is regained.

Access iOS app documents directory from OS X

I'm working on an iOS app that creates some files and saves it in its documents directory. It would be really helpful for this app if I could create an OS X app that could access that apps documents directory as well as the pictures on the device. I know it's possible because of this app, but I can't seem to find a way to implement it. The iOS app does need to be approved by apple, but the desktop app doesn't. With these apps I am targeting non-jailbroken iOS 5 devices and OS X Lion. Any ideas on how I could do this?
A few other solutions I am considering:
upload the apps documents directory to iCloud and then download it on the desktop
upload to dropbox for auto syncing
make the desktop app into a server and upload from the app to the desktop over the network
Those are all backup solutions, but it would be great if I could do this without having to depend on the network.
Take a look at: libimobiledevice. It's a library designed just for that. Anyway, all of this is not supported by Apple, as there isn't any public API for accessing the filesystem.
You can make your device to act as a HTTP server. There are several 3rd parties libraries that can help you get started. I personally have used iPhonrHTTPServer3 which is based on CocoaHTTPServer?

Copying data from a free iOS version to a full version of my app?

How could a full version of my iOS app access / copy the database / settings from the free version ?
I'm thinking of providing a free version of my app and I can't see how people then buying the full version could get access to the data from my free version ?
All apps are isolated on iOS. They are installed as different iOS system users. One user do not have permission to access another user's files. In the old times, one common approach to address this problem is to enable iTunes file sharing. And tell users to manually copy the files.
Your better bet is to use the freemium model to sell your app. Make the app free, and unlock extra features via in-app-purchase. This way, your files, documents, settings won't need transferring to the pro version. The app itself becomes pro after unlocking.
Here is the guide from Apple: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html (though not very intuitive).
The walkthrough here: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/ is very helpful.
Last but not least, be aware that in-app-purchase is crackable. So please read: How to detect "IAP crackers"? , Verifying In App Purchase Receipt from Client , and https://stackoverflow.com/questions/4715414/apple-in-app-purchase-verify-receipt , verify in app purchase , In App Purchase Receipt verification within app .
Note that you are supposed to setup a server to validate iap receipts. Though it's doable from within the app, it's not safe. As far as I can remember, you can test in-app-purchase through StoreKit in iOS simulator v5.0, that should be Xcode 4.2. Before that, it can only be tested on a device.
#Dominik Hadl mentioned you can use a server to sync the file. The operation is usually complicated. If you prefer this idea, you can choose to use custom url scheme to launch one app from another to ease the operation. See steps below:
User press "Begin sync" in the free app to upload the file to your server
Server return the ID of the file to the free app
User press "Launch Pro App and Download my file", which leads to a custom url scheme to launch your Pro version (must be installed first), with the file ID
Pro version use the file ID to download that file directly
I think the only way how you can do this is syncing the data with some server, registering the device and the syncing the data back to the full version.
Because all iOS apps are sandboxed, they can't access any other application data (unless you have jailbroken iOS).
Since multiple apps can share the same iCloud container, I'd say that the best practice nowadays is to "simply" store the data in iCloud.
(I'm putting "simply" under quotes, because it is easy to put data in iCloud and take it out; but if you actually want to do syncing, you may need to do more than just "I'll load from iCloud and save to iCloud" in order to provide the best experience to the user.)

Can I use Keychain Across iPhone Apps, from an SDK?

I am writing an SDK which will ship as a static library. Can I access the keychain to store data so that I can retrieve it in another app which also has my library? Seems like Apple would frown upon this, since I did not sign the apps, but am merely a passenger in the app's code.
Was looking at using "SFHFKeychainUtils" to help implement this. Any thoughts?
AFAIK, the keychain can only be shared across apps with the same Bundle Seed ID (which would be controlled at the signing level, as you say). As such, the only apps that would be able to share keychain access would be apps from any single developer. Cross-developer sharing is a no-go.
Check out more iOS security info here in Apple's docs.

How can I make an SQLite database within an iPhone app available to the desktop?

My Android app stores its SQLite database on the SD card, so that when the phone is connected to a PC my desktop application can access it using an ODBC driver. Is a similar technique possible on the iPhone?
I know that iPhones do not have SD cards.
I use iTunes file sharing to access sqlite DBs on both the iPhone and iMac; iTunes moves the data. Enabled in the plist
As it has been said, it can't be done.
However what you could do is to embed a small Web Server into your App, and let the users to download the DB ( or even visualize it ), via WiFi on their homes/work. This approach would work for Windows/Mac/Linux users, and several apps are already doing it this way.
Good luck!
Not built-in, unfortunately. You'll have to roll your own Wi-Fi syncing system. You could use iCloud when it comes out in the fall, but that only works on Macs for now.
SQLite is present in the iPhone SDK, but there's no way to flag a file stored by your application as being visible to the file system when you plug your iPhone into the computer. As stated already by Chris Long, Apple's answer to this criticism is iCloud, which allows you to do synchronisation between arbitrarily many devices without cables, but that isn't available yet. The iOS 5 beta is available to registered developers and is publicly known to function with iCloud, so you could start developing now.
More painful temporary alternatives are to email the database out (there's a supplied way to do in-app email) or to expect your user to drag and drop the thing out of iTunes.