I'm adding CloudKit to my app and I'm trying to save a record like so:
try await CKContainer.default().privateCloudDatabase.save(record)
When I run via Xcode on my personal iPhone, it comes back and says:
CloudKit access was denied by user settings
I am not seeing how I request access from the user.
Related
I have two apps and using same firebase project for both the apps , and i want to check if the user logged in through the first app , then if he open the second app for the first time get the data if the current user is logged is or not with the same email. Is it possible to check this through firebase or i have to do it locally .
I have a react/django project and we need to somehow access the contacts of our users. I was told to look into CloudKit's API in order to take care of this, however there seems to be no real information in their docs or in my Google searches on using this API to specifically access a user's contacts.
I am open to other suggestions as well. The ideal would be to access their contacts initially and then every so often compare their contacts to our list to see if any have been added.
You cannot access this data from a third-party app via a CloudKit API.
While Apple does store a user's contacts on CloudKit, they do so under these conditions:
The user opts-in to sync their contacts with iCloud (this isn't required for iOS users; they can be on-device only, or sync with another service like Google).
The contacts Apple stores on CloudKit are in a container that is private to Apple.
When you use CloudKit as a developer, you are creating a container for your app. You can only access data in containers you create.
Here's what you would have to do:
Create an iOS or macOS app that requests/manages access to the user's contacts.
Add the Contacts entitlement to your target in Xcode: Signing & Capabilities > App Sandbox > App Data > Contacts
Use Apple's Contacts framework to access contact data using Swift in your iOS/macOS app.
Once you have the data in your Swift app, communicate with your Django API to do what you need to.
One last thing. If you choose to go this route, you will have to reveal in your app privacy disclosures (in App Store Connect) what you are doing with the users' data.
I'm wondering if it's possible for me to access a user's private database on the Development schema as the app developer. I'm just testing locally on my devices, but I need to be able to inspect the records of devices not associated with my developer account for debugging purposes.
Thanks so much!
The only way to do this is to sign in to the CloudKit Dashboard with that user's Apple ID. Their data is otherwise private.
Alternatively, you could create a mechanism in your app that pushes a user's data to the Public database of your app for help/troubleshooting purposes. That data is visible to you there as the app developer and you could download and inspect it.
I'm trying to delete the user's login credentials and push notifications permissions from my test iPhone 4.
When I delete the app, it still remembers the user's login credentials, and it doesn't reset the push notification opt-in permissions.
How can I reset this data?
These are two separate problems.
For the login problem, sounds like you're storing the user's login credentials on the keychain. The only way to wipe this out is to either do it via code, logging out and then deleting the app, or doing a factory reset on the device.
About resetting the push notification status, it's mentioned in an Apple Technical Note here:
https://developer.apple.com/library/ios/technotes/tn2265/_index.html
Scroll down to "Resetting the Push Notifications Permissions Alert on iOS"
May be it will be a too startup question.
We have developed an iPhone application and its uploaded in the Appstore. We have our own login mechanism, facabook login, and twitter login. Our users reporting an issue that, when the app is started and the iphone device is restarted (switched off), the application is also logged out. And users needs to login again. We have checked Facebook app. It keeps logged in when the device is restarted (switched off). We also want to do like that. Can you have suggest mechanism to do like that.
Store the Username and password in the keychain. When the app starts up, then grab the username and password from the keychain and execute the method for login.
John
You can can Store your acessToken (facebook) with NSUserDefaults, CoreData or FileSystem. I will not suggest you to save your login/password inside your app. If you need to do this, its better save data user(name,address,celphone...) but not the access, like login/password. Its more safe. Of course, you can use KeyChain, but will each in what are you thinking doing with the app.
NSUserDefaults
Save string to the NSUserDefaults?
File System - apple guide
http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html
Core Data
Save and Load Data - CoreData