Hi,
I'm implementing iCloud backup functionality in my web application using CloudKit JS, but I'm running into some issues. I'd appreciate any help you can provide.
Issue: The iCloud backup feature isn't working properly in our web app. I believe I've correctly set up the Apple Developer Program registration and API token generation. While a demo implementation works perfectly with iCloud backup, our app implementation is failing.
Specifically:
- "Sign in with Apple" succeeds
- However,
ck.getDefaultContainer().setupAuth()returns null - In the working demo,
setupAuth()returns a proper value - Even after logging in through the redirect URL provided in the "421 Misdirected Request" error response and executing
setupAuth(), it still returns null
I've essentially copied the working demo code directly, so I suspect the issue might be related to token generation, permissions, or account configuration.
Questions:
-
Could you provide detailed step-by-step instructions for implementing iCloud backup in a web application? I've noticed there are configuration items in the Developer Console and Certificates console, so I may have missed something in one of these areas.
-
Based on the symptoms described, what are the possible causes for
setupAuth()returning null in CloudKit JS? Could configuration issues be indirectly causing this, or is it more likely a timing issue or SDK coding problem? -
Specifically regarding the 421 error and redirect flow - is there something in the configuration that could cause
setupAuth()to return null even after successful authentication through the redirect?
Thanks in advance for your help!