Post not yet marked as solved
I need any kind of help I can get on this question and am open to any solutions or workarounds.
When I archive FileManager.ubiquityIdentityToken with NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:), what should I set the second parameter to in order to be able to unarchive later, and how do I unarchive the Data object using unarchivedObject(ofClass:from:) or any other method of NSKeyedUnarchiver?
My code currently uses the deprecated method of archivedData(withRootObject:), which gives me a code time warning saying:
'archivedData(withRootObject:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
I'm getting code time error messages in red for the argument to archivedData(withRootObject:requiringSecureCoding:) which is declared as type Any. I tried different arguments. The one I this should work is (NSCoding & NSCopying & NSObject).Type, which generates two error messages:
Static method 'unarchivedObject(ofClass:from:)' requires that '(NSObject & NSCoding & NSCopying).Type' inherit from 'NSObject'
Type '(NSObject & NSCoding & NSCopying).Type' cannot conform to 'NSCoding'
Setting the argument to (NSCoding & NSCopying & NSObject) generates the error message:
'NSObject & NSCoding & NSCopying' cannot be used as a type conforming to protocol 'NSCoding' because 'NSCoding' has static requirements
I haven't been able to discover what that means that 'NSCoding' has static
I get the idea to use (NSCoding & NSCopying & NSObject) because when run code:
print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken))")
the debug window shows
type of FileManager.default.ubiquityIdentityToken: Optional<NSCoding & NSCopying & NSObject>
but when I run the following code
print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken!))")
I get the following in the debug window
type of FileManager.default.ubiquityIdentityToken: _NSInlineData
I read on stackoverflow that "_NSInlineData" is not made available to us by Apple.
I'm open to doing this any other way, not necessarily with NSKeyedArchiver or NSKeyedUnarchiver, including using unsafe pointers if necessary.
In one of Apple's documentation or sample Xcode projects, I found code to check the login status of a user on iOS when an app logs on by checking FileManager.ubiquityIdentityToken and to check the current status with the previous status by checking the ubiquityIdentityToken that was saved in UserDefaults. Is there a better way of doing this?
Post not yet marked as solved
This documentation: Documentation/Bundle/Resources/Information Property List/Data and storage/NSSupportsPurgeableLocalStorage says:
Property List Key
NSSupportsPurgeableLocalStorage
A Boolean value indicating whether the app continues working if the system purges the local storage.
Under what conditions does the system "[purge] the local storage", and does this mean the entire local storage for the app? I can see how when a user deletes an app the local storage would be deleted, but then the app would not continue working, since it's no longer on the device.
Hi Dev Team,
I don’t see many answers on this topic but this seems to be a real concern for many users.
I went from my IPhone 8+ with 256gb and I had 39gb used, about 7gb was other storage no big deal. I decided to go with an iPhone 12 Pro Max 128gb. I now have 60gb used of which 26gb is other storage!!! I have done 3 clean installs from different iCloud backups and no change. I do not buy an iPhone to see half of my storage being used by other and system storage.
Also I do not explain why I now see some gb with photos and messages as it is normally all stored on iCloud (I have 2.2tb). Same thing I do not subscribe to iCloud or AppleOne to have data store on my iPhone while it should be all on iCloud.
I did not have this on my 8+. I called Apple but they were clueless...simply telling me that it is normal and that it may take a few days for things to get back to normal...it is not true.
is that a bug? My iPhone flash memory corrupted?Will this be taken into consideration?
Anyone else having this issue please post.
Thanks much!
X
Post not yet marked as solved
hi guys, com.apple.bird was taking up almost 100 gb of storage on my mac and I had 0 mb of storage left so i deleted it completely. Should i have done that?
Post not yet marked as solved
Hi. I want to make a planner app that has the date and location of the project. Only I have a problem. I used a "DatePicker" so that the date is counted. Only I do not know how to save and display the selected date.
In general I have problems to save and reload the content of the variables and texfielders etc. I thought that these contents are automatically saved on the end device of the user.
I have read that there are methods like "UserDefaults", "CoreData" or "AppStorage". Have been reading stuff about this forever. But I can't get this to work. I hope someone would like to donate their time to help.
Greetings
Janik
Post not yet marked as solved
Hi,
I have a very strange behavior on an iPhone SE (1st gen, 32 GB, iOS 15.5).
It was overloaded (less than 1 GB free remaining).
After trying many things unsuccessfully to free up memory, I decided to Erase All data and set it up as new device, so without restoring it from a previous backup.
After that reset, it has now about 21GB of system data and only 2 or 3 GB free.
I have erased it multiple times... Same thing...
Nothing has been installed on the phone after the reset of course.
The strangest thing (IMHO) is that if I connect the phone to my Mac, Finder says that I have 22 GB of free memory and doesn't see the 21 GB of system data. But if I try to upload some big files on the phone transfer stalls after 2 or 3 GB...
Is there any chance to purge those system data ?
Hope I can find help on this...
Post not yet marked as solved
We are developing an Apple Arcade title.
I have a question about data storage on tvOS.
iOS and Mac can use his GKSavedGame, but tvOS cannot.
https://developer.apple.com/documentation/gamekit/gksavedgame?language=objc
At tvOS, we are considering using iCloud Key Value Storage or CloudKit.
Are these available on Apple Arcade?
Also, could you please tell me if there is a standard way to do cloud saves on Apple Arcade?
Post not yet marked as solved
I'm trying to build an educational SwiftUI iOS app with course videos. I've tried storing these videos on YouTube as private videos and also Vimeo. But they both show the video controls which allows the URL to be extracted, which I don't want.
Storing the videos as a local resource is a no no otherwise the app would be several gb's.
I can also store the videos just on my web hosting, but again I think these are discoverable and I don't want to go down the route of creating log ins and user accounts.
Are there any other solutions of doing this? Is it possible to store the videos in Firebase and get the app to access them stored there?
Post not yet marked as solved
I have a cloud storage app. Right now, saving files into it creates my app's folder in On my iPhone. Is it possible to have my app's folder outside of it, in Files app's Locations list? Just like I have other cloud providers like Dropbox, OneDrive etc(see image).
Hello community!
I created an app with a golang shared library which runs a mkdir command at start. The app is working properly on emulator but not on physical device, looks like the emulator is properly sandboxing (wrapping) the shared library but in my iPhone I get a permission denied error (probably due to the app trying to write on File system)
How can I reproduce the same sandboxing approach on my physical iPhone as in the emulator?
Below you can see how the path for each looks like:
Emulator installation path(All goo here):
/Users/simbadmarino/Library/Developer/CoreSimulator/Devices/E6258FFC-CA3F-4B7F-BAAE-DDF717096A91/data/Containers/Data/Application/6BA771DD-BE68-454A-926E-A525188CBE38/.btfs
Phone installation path(Permission errors here):
/private/var/mobile/Containers/Data/Application/CB3B300F-07D8-4641-A6FA-4F584D4C6530/.btfs
Post not yet marked as solved
Hi guys,
Never come across this issue when I switch to a new 2021 MBP 14" M1PRO.(base setup)
Happens quite often when I'm saving my blender file, pops up an error saying not enough space. (where after migration I should have about 250GB still.)
After going through the storage management tab I came across the " Library - Caches - Cloudkit - com.apple.bird"
is eating up 251 GB of storage.
I've tried to delete the folder, it pops back right away. and gradually increase it's size till it's full again.
Strangely, if I leave the laptop overnight, sometimes the storage will clean up by itself again.
Yet, it will continue a behavioral loop on daily basis to a point it's not useable for a new MBP.
Does anyone have any idea what it could be or any solutions?
greatly appreciated!!
Post not yet marked as solved
I have been excited to add NSPersistentCloudKitContainer's share functionality to my app but I've noted a few thing I suspect are bugs:
-When using share() on a NSManagedObject the share record is set up in a new zone. However, the root NSManagedObject's record is not being updated with the relationship linkage to the shared record.
-Secondly, when you revoke a share, the cloudkit.share record is removed from iCloud, but not in the local data stores. This makes the fetchShares() method ineffective for detecting a missing cloudkit.share record. In order to re-share the root object the developer must call out to iCloud directly using the old methods to be sure if the share exists or not.
I am using the code from Apple's 'Synchronizing a Local Store to the Cloud' sample. It would be nice if they added support for revoking shares into this sample and addressed these issues.
Post not yet marked as solved
Hi,
I wanted to offer the UI for editing and deleting a share.
So for using
UICloudSharingController(share: , container: )
I implemented the delegate to call "persistUpdatedShare" in "cloudSharingControllerDidSaveShare"
func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) {
if let share = csc.share,
let privatePersistentStore = PersistenceController.shared.privatePersistentStore {
PersistenceController.shared.container.persistUpdatedShare(share, in: privatePersistentStore) { (share, error) in
Thread.performOnMain {
if let error = error {
PersistenceController.shared.storeWarning = error
}
}
}
}
}
and to call "purgeObjectsAndRecordsInZone" in "cloudSharingControllerDidStopSharing"
func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) {
let puzzleToShare = puzzleToShare
if let share = csc.share,
let privatePersistentStore = PersistenceController.shared.privatePersistentStore {
PersistenceController.shared.container.purgeObjectsAndRecordsInZone(with: share.recordID.zoneID,
in: privatePersistentStore) { (zoneID, error) in
Thread.performOnMain {
if let error = error {
PersistenceController.shared.storeWarning = error
} else {
puzzleToShare.makePrivateDuplicate()
try? puzzleToShare.puzzle.managedObjectContext?.save()
}
}
}
}
}
I got this implementation from a TSI, but it makes no sense to me to delete and duplicate my objects rather than just keeping them and only deleting the share.
Question:
How can I cleanly discontinue a share, but keep my data. Duplicating my objects seems such a weird approach. But without this implementation it does not really work. (I get strange behaviors and crashes)
All the best
Christoph
Post not yet marked as solved
Hello
I'm developing Simple memo-app
This memo-app supports iCloud synchronization(default)
I want to notify the user, it who has a lack of iCloud capacity.
But, I do not know how to know the capacity of the user's iCloud in my app. (this app used Cloudkit(PersistentCloudKitContainer).)
I have any way to know user's iCloud capacity in the iOS app? or I want to know, How much iOS App is occupying the user's iCloud.
I would like to know the user's iCloud remaining space.
I would like to know iOS App is How much occupying the user's iCloud.
Post not yet marked as solved
ISSUE:
"testL2R" is a local folder added. After uploaded to server, I set its meta as isUploaded=YES and set the badge as SyncDone, and signal its parent. Through fileproviderctl tool, I can see the badge name is correctly set. But finderUI never update unless I go to root folder and reenter Private folder again.
I also tried signal workingSet, signal multiple times. Neither of them work. How can I get FinderUI updated?
Post not yet marked as solved
Please tell me if there is any recommended method of persisting data (app token - string type) through app reinstallation.
With the answer from:
https://developer.apple.com/forums/thread/36442?answerId=281900022#281900022
The suggestion of using DeviceCheck is not working for me since DeviceCheck will generate a random token, and with that token, our backend can only request for two bits.
Storing data on a device keychain will have an indeterministic future but seems like it's the only viable option for now.
Post not yet marked as solved
hello guys, recently i have a project with my team which need to use cloud kit for the apps. but it turns out that my other teams cannot use the icloud/cloud kit that i make in my xcode. is there any way to share this cloud kit so we can work together with it?
ps: I join the individual developer account
I've been struggling to get the root path of local storage provider. E.g. /private/var/mobile/Containers/Shared/AppGroup/0C7A3DB2-BA52-4B54-XXXX-E95027E673A9/File Provider Storage.
Users can grant access to folders for our drum sampler app in order to use audio samples without importing them and because we have facilities to quickly explore samples.
There are two reasons why i want to use this:
To display "On My iPad"/"On My iPhone" when users explore the file
Preferably in project files we would like to store paths to files in a way that projects still open correctly after re-installation of a user's device.
After poking around it seems that File Provider Storage is basically just an app-group named group.com.apple.FileProvider.LocalStorage however we don't have permissions to join that group.
Post not yet marked as solved
I've downloaded the Fruit Basket demo project to get a better understanding of how to implement a file provider for macOS.
From running the program and looking through some of the code, I believe I have a vague notion about what it does, only I'm still unsure about a lot of things.
Where can someone find more information about how Fruit Basket is supposed to work and how it can be used?
Hi,
I'm currently let the user pick a photo using PHPickerViewController.
The advantage of PHPickerViewController is that the user is not requested to grant photo access (no permission alerts).
After the user picked the photo I need to take note of the local identifier and the cloud identifier (PHCloudIdentifier).
For the local identifier no problem, I just use the assetIdentifier from the PHPickerResult.
For obtaining the cloud identifier (PHCloudIdentifier, on iOS 15 only) I need to use the cloudIdentifierMappings method of PHPhotoLibrary.
The problem of that method is that is causing the photo library access permission alerts to display.
Someone know if there is another way to get the cloud identifier from a local identifier without having to prompt the user photo library access?
Thank you