Here's the deal. My app is using Defualt Public CloudKit container to provide some images. The app works well on my iPhone and different simulators on iOS 8.0. I submited my app and it's on app store now but the Cloudkit functionality does not work on the app downloaded from app store.
Is there anything I should have done within the code or setting? Here is my Xcode setting.
OK I found where I was wrong. I put it here for other people. We need to deploy the Development Environment to Production Environment in CloudKit dashboard.
The Development and Production Environments
CloudKit provides separate development and production environments for your record types and data. The development environment is a more flexible environment that is available only to members of your development team. When your app adds a new field to a record and saves that record in the development environment, the server updates the schema information automatically. You can use this feature to make changes to your schema during development, which saves time. One caveat is that after you add a field to a record, the data type associated with that field cannot be changed programmatically. To change a field’s type, you must delete the field in CloudKit Dashboard and add it again with the new type.
Prior to deploying your app, you migrate your schema and data to the production environment using CloudKit Dashboard. When running against the production environment, the server prevents your app from changing the schema programmatically. You can still make changes with CloudKit Dashboard but attempts to add fields to a record in the production environment result in errors.
Note: iOS Simulator works only with the development environment. When you are ready to test your app in a production environment, do so from a device. During development, Xcode automatically points your app to the development environment. Before you ship your app, configure your app using the distribution workflow. In this workflow, Xcode lets you choose whether you want to target the development or production environment and adds the com.apple.developer.icloud-container-environment entitlement to your app with the value you selected. Prior to shipping, be sure to configure your app for the production environment. Apps that target the development environment will be rejected by the App Store.