Watch Extension iCloud capabilites, which target? - xcode

I added Core Data with iCloud support to my watch extension, but it's not syncing with the phone (phone and iPad do sync). I added the iCloud and notification capabilities to the My App Watch Extension target, but on Xcode, you don't seem able to add it to the My App Watch target? Could this be my issue, that the iCloud capability is only added to the one target on the watch instead than on both?

If you try add to ...Watch, you can't do it.
You should add it to ...Watch Extension.

Related

iOS8 crash when try to use UIDocumentMenuViewController

I use Xamarin.Forms to create iOS app and I use UIDocumentMenuViewController to Access iCloud file.
When I run program on iOS9+ program is run normally, But when I try my program with iOS8 emulator program is crash on
new UIDocumentMenuViewController(allowedUTIs, UIDocumentPickerMode.Import);
and message is saying
'Application initializing document picker is missing the iCloud entitlement. Is com.apple.developer.icloud-container-identifiers set?'
What wrong with my app and how can I fix this?
Thank you in advance.
You need to make sure that you have enabled the iCloud Entitlements as described here.
This is even mentioned in the official iOS documentation:
Before your app can use the document picker, you must turn on the iCloud Documents capabilities
If you haven't done so already, simply create a new Entitlements.plist file in the root of your project. Then simply enable the iCloud option.
Check that you have linked Entitlements.plist to your project...
I dont know why, but by default Entitlements.plist is not linked, you can do the same by going to option of project and assign custom Entitlement like this!

Xamarin iOS Watch can't install on watch

I have an iPhone app on Xamarin working. I just added a Watch extension project. I can deploy the app on my iPhone device, but when I try to install it on my Watch device, it fails when it reaches near 100% (icon visible with progress), and then uninstalls. There is no error message either. Any idea why?
Does your provisioning profile include the watch device? Please see:
https://developer.xamarin.com/guides/ios/watch/deployment/device/
Testing iOS apps on a real iPhone or iPad has always required the device to be registered on the Dev Center...
Watches are no different - you now need to add your Apple Watch device before deploying apps to it. Find the watch's UDID using Xcode (Windows > Devices list)...
When you know the Watch's UDID, add it to the device list in the Dev Center:...
Once the Watch device has been added, ensure it is selected in any new or existing development or ad-hoc provisioning profiles you create:
So once you add your watch to the Devices in your Apple iOS Portal, you will have to regenerate and re-download your provisioning profile after including the watch device in the profile.

xCode exclude watchkit extension for submitting

I wrote an app using watchkit and wanted to submit it yesterday after Apple releases iOS 8.2. Unfortunately I got to know here on stackoverflow, that apps using watchkit are not allowed to be submitted yet...
I do think that my app is also good as a standalone iPhone app and would like to submit the watchkit part as an update as soon as it's possible.
What is the best way to exclude the watch extension from my archive I want to submit? I don't want to build up a whole new project if possible.
I tried unchecking the "Target Membership" of the Extension.appex in my products folder. I then got this error:
How can I exclude the watch extension the right way?
If you want to exclude the WatchKit extension from your app, you just need to remove their targets from the targets list in your project. And remove their related files and groups.

How can I remove Watchkit from my App?

I want to remove Apple Watchkit from my App until the new version of IOS is released. This is so I can upload releases of the App until we can upload Watchkit based Apps.
I deleted the 2 Folders:
Twoater WatchKit Extension
Twoater Watchkit App
I then deleted the two Targets of the same name.
I built the App successfully.
I then tried to run the simulator and got a LaunchError = 0.
So something somewhere is not correct.
Did I remove the Watchkit in the correct way or is there a better way of doing it to ensure that all config files are properly adjusted ?
What you're doing is quite a bit overboard.
You should just create two separate schemes: one which includes the WatchKit App Extension and App (for testing for iOS 8.2) and one that doesn't include it (for testing with iOS 8.1 and submitting to the store).
You'll need to provide more details on your error running in the sim. See An error was encountered while running (Domain = LaunchServicesError, Code = 0)

UIDocumentPickerViewController & iCloud entitlement in IOS 8

I have a document based app in App Store. Now I am trying to use UIDocumentPickerViewController in my app to share the file from my app UIDocumentProviderExtension supported apps.
Previously I have used UIDocumentInteractionController to transfer files between apps. The problem is when I used UIDocumentPickerViewController, I got the error "iCloud entitlement missing" in app.
According to the Apple document, I need to add the iCloud entitlement if my app supports the iCloud storage, but it's not a requirement for my app. So, I want to understand what is the need of iCloud entitlement for presenting UIDocumentPickerViewController?
the UIDocumentPickerViewController allows your app to access the shared iCloud documents even if your app does not support iCloud document storage itself. This is the default behavior of the UIDocumentPickerViewController.
So if you want to use the UIDocumentPickerViewController you have to add iCloud entitlement to your App ID.
If not, you might want to create an DocumentProviderExtension in your app. Then you don't need to add the iCloud entitlement to your app id and your users can access your documents from within their preferred app (which has a UIDocumentPickerViewController).

Resources