UIDocumentPickerViewController & iCloud entitlement in IOS 8 - ios8

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).

Related

Watch Extension iCloud capabilites, which target?

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.

IOS application permissions

I'm developing my first app and trying to upload it to the app store connect.
In my info.plist I've the key-value:
<key>NSAppleMusicUsageDescription</key>
<string>load music for process</string>
I'm asking this permission while the app is running.
Should I declare about this permission in the app store connect or the info.plist is enough for the review?
Just at Info.plist, but you have to explain a little better what you use this consent for, because Apple may not accept Review.

Allow App Data to be downloaded to iCloud (Nativescript)

My Nativescript iOS app saves some user created data using the nativescript-localstorage plugin. I want to be sure that users have a place to back-up this data.
The most straightforward option seems to be that they can include the app's data in an icloud backup (ie, icloud -> icloud Drive -> then allow the app to be backed up in the drive).
When I have used "$ tns run ios" and run the app locally on my phone, the app properly runs on my phone, but it does not appear as an option for backing up to icloud. On the icloud backup screen where apps are listed that you can choose to backup, my app does not appear.
This might be because it is just a local build, and only full releases (apps received from the app store) can be included in icloud backups, but I have not seen this confirmed anywhere.
Do I need to do anything to enable my app to be available for icloud backup?
I have figured out the key piece I was missing--that there are two different types of iCloud uses:
(i) the system-wide iCloud backup that happens automatically if the user turns it on (app developer does not need to take special action) and (ii) the iCloud as a cloud storage solution for certain data that you as the programmer need to configure.
For iCloud with CloudKit to show up as a specific feature of your app, this requires (ii)--and further configuration than just enabling it.
Further detail in my answer here.

Can I use In-App-Purchases when distributing outside of Apple's App Store?

I'm new to mac os app development and the documentation doesn't ever say that this is not supported (as far as I could tell).
Can I use IAPs if I don't submit to the App Store?
Is there anything different that I should do to setup IAPs when distributing outside of the App Store?
It looks like this is not possible, as documented here:
https://developer.apple.com/macos/distribution/
Only iCloud and Push Notifications are available.
I think its possible by following instructions below.
Go to itunesConnect , Users and Roles, Create a sandbox user . I am thinking you have already made the in app purchase items in your app in itunes connect. Now in your device log out the Appstore ID from settings. Do the in app purchase using the Test user credentials you created, and it will make the in app using a sandbox environment.
For more info about In App follow this link :
https://www.raywenderlich.com/122144/in-app-purchase-tutorial

iCloud set up and provisioning

I am trying to set up iCloud within my iOS application, I have done the following:
Removed all old certs on mac.
Added iCloud to the App in Dev Console - created new container and added to app
Redone the dev provision and downloaded
Installed the provision
Added the iCloud Entitlement to the app
And this is where is all goes wrong...
I can't get the app running again, the app is building but I am getting an error saying:
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
Any ideas??
UPDATE: I have managed to be able to run the application to get everything programmed and put in place, everything is set up iTunes Connect end, all provisions are valid and sync'd.
Now I am getting errors during validation...
There are 4: Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported by iOS. Specifically, key 'com.apple.developer.icloud-container-identifiers' in Payload ------- not supported
Other 3 are similar for other containers!
Maybe it's a late comment, but I post it here in case that somebody is struggling for the same reason.
I encountered this issue on Xcode8 recently when I was trying to archive. Generally, I enabled iCloud with Xcode in following steps:
Enable iCloud inCapabilities panel in my target by setting the toggle to ON.
Check iCloud under my App Identifier in Member Center turns green automatically, and a iCloud container is created automatically with my App Identifier. (Apple's system does this for us.)
Regenerate my certificate with my App Identifier.
Create a new provisioning profile.
Download and install the new certificate and provisioning profile
Select the new provisioning profile in Signing(Release) section in General panel in my target.
Then I got errors like:
Provisioning profile "iCloud Test" doesn't include the com.apple.developer.ubiquity-container-identifiers,
com.apple.developer.icloud-container-identifiers,
and com.apple.developer.icloud-services entitlements.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
At last I found that there were two options in iCloud section under my App Identifier in Member Center. By default, the Compatible with Xcode 5 was selected, but I succeeded by selecting the other option.
If you're just adding iCloud to an app for the first time or want to upgrade to use CloudKit after using an older iCloud container:
Go to the Apple Development Center.
Choose Certificates, IDs & Profiles.
Use the dropdown on the top left to switch between iOS/tvOS/watchOS or macOS
Choose App IDs under the Identifiers section.
Choose your app from the list.
Scroll down to iCloud and make sure it is enabled with a green dot.
If it's not enabled or has a yellow dot, click the button at the bottom of the page to Edit and make sure you've checked iCloud service.
You may also need to create a container under the iCloud Containers section then associate it with this app.
After submitting a report to Apple, it turns out that Apple systems are useless AGAIN!
Ok, so if you are creating a NEW application or you are only just adding iCloud to your application - you will need to make sure the system doesn't pick up or create a iOS8 cloud container!
If it does you need to remove it from your app entitlements file, remove the selected containers in the Apple Developer Console and re-download certs again!
Thanks Apple again!
I got blamed for using pre-released software! I haven't touch Xcode 6 yet!!!
What I did:
- leave only com.apple.developer.icloud-services in entitlements file
- in Capabilities under iCloud marked key value storage and iCloud Documents (cloud kit EMPTY)
- Containers set to specify custom but do not select any of your containers
- This will probably give you RED warning sign under steps but leave it as it is DO NOT FIX
- Regarding provisioning profile Development and Distribution profiles have to have App ID which has iCloud enabled but NOT linked to any container
- In those provisioning profiles set under iCloud OLD version for Xcode 5 etc. not a new one related to iCloud containers
I had an error of "Add iCloud Containers to your App ID".
Automatic signing was unable to resolve an issue with target's entitlements.
I don't even use iCloud Containers, only Key-value storage(keychain).
I also switched in iCloud section under my App Identifier in Member Center from "Compatible with Xcode 5" to "Include CloudKit support (requires Xcode 6)" problem still remains.
So I fixed it like this:
Enable iCloud Capabilities panel in my target by setting the
toggle to ON.
Turn on "Include CloudKit support (requires Xcode 6)" in Member
Center (still got same error).
in Xcode in iCloud Capabilities TURN ON CloudKit (even if you don't
need it) and then turn OFF.
And then problem solved for me!

Resources