We are developing an app where we need to store some information in iCloud and that should be synched across the devices.
For this to happen we should force the user to enable the iCloud for the app. Can we do something like,
After launching the app just check whether the iCloud is enabled for the app, if not alert the user to enable the iCloud and try again? Without enabling iCloud we don't allow user to get in to the app.
Will Apple allow doing this?
I think we can't force user to enable the iCloud and it is up to them enable it or not. Is my understanding correct?
Yes, your understanding is correct. You can't force a user to enable iCloud on their device. And that is a good thing.
You need to rethink this. What about users with only one device. There is no point to forcing such users to use iCloud with your app. There are no other devices to sync with.
In the end, you can check to see if iCloud is available or not. If not, you can tell the user that your app does require it (for some unknown reason) and prevent them from continuing.
No one here can say for sure if Apple will allow this or not. I know that as a user, I would not be happy with an app that only worked if iCloud was enabled. It should be the user's choice.