Add setDiskSpaceImplementation public API for developer-supplied disk space implementation
Description
The intent behind this PR is to comply with Apple Privacy Manifests, while also giving developers the option to comply themselves and provide us the statfs function implementation.
TODO
- [ ] Decide if this is an approach we want to take. There's some risk that Apple is also scanning for the
struct statfstype, in addition to thestatfsfunction, but nothing in their docs says they do. If that's the case, we can add more onus on the developer to implement a function that returns free and total disk space at the time of the crash. - [ ] Go through API review
- [ ] Test in a testapp (Swift, ObjC, and other non-iOS platforms)
- [ ] Add Changelog
API
What's interesting about this API is it introduces a static method, and it must be called before FIRApp configure. I think we could make this more future-proof by making this category of APIs fall under a single method call. See the code comments for why this requirement exists.
Eg. we could call it [Crashlytics setStartupDependencies:...], and it could take a dictionary or NSObject. One of the fields in this dictionary or NSObject could be statfs or diskSpaceFunction.
Apple API Diff Report
Commit: 9c731acf93016d1b20762a3d0dd17fa7af1fb6a7 Last updated: Wed Jan 31 14:03 PST 2024 View workflow logs & download artifacts
FirebaseCrashlytics
[ADDED] Structures
Objective-C:
+ struct statfs
Classes
FIRCrashlytics
[ADDED] +setDiskSpaceImplementation:
Swift:
+ class func setDiskSpaceImplementation ( _ implementation : ( UnsafePointer < CChar > ?, UnsafeMutablePointer < statfs > ?) -> Int32 )
Objective-C:
+ + ( void ) setDiskSpaceImplementation : ( nonnull int ( * )( const char * _Nullable , struct statfs * _Nullable )) implementation ;
| 1 Warning | |
|---|---|
| :warning: | Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.) |
Generated by :no_entry_sign: Danger