Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setDiskSpaceImplementation public API for developer-supplied disk space implementation #12339

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

samedson
Copy link
Contributor

@samedson samedson commented Jan 31, 2024

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 statfs type, in addition to the statfs function, 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.

Copy link
Contributor

Apple API Diff Report

Commit: 9c731ac
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 ;

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants