-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix tvOS storage issues. #6658
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
Fix tvOS storage issues. #6658
Changes from all commits
03be979
c1e2dae
7a74299
e85f3e6
f836d19
d0da96a
e89b159
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Unreleased | ||
- Legacy pre Xcode 10 compatibility checks removed. (#6486) | ||
- `GDTCORDirectorySizeTracker` crash fixed. (#6540) | ||
- Fixed writing heartbeat to disk on tvOS devices. (#6658) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ryanwilson I don't see any changes that go with this CHANGELOG update |
||
|
||
# v7.4.0 | ||
- Limit disk space consumed by GoogleDataTransport to store events. (#6365) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,12 +53,17 @@ - (NSURL *)fileURL { | |
return _fileURL; | ||
} | ||
|
||
/** Returns the URL path of the Application Support folder. | ||
* @return the URL path of Application Support. | ||
/** Returns the URL path of the directory for heartbeat storage data. | ||
* @return the URL path of the directory for heartbeat storage data. | ||
*/ | ||
+ (NSURL *)directoryPathURL { | ||
#if TARGET_OS_TV | ||
NSArray<NSString *> *paths = | ||
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the fix. I created #6662 for a specific tvOS implementation to improve reliability of the heartbeat. |
||
#else | ||
NSArray<NSString *> *paths = | ||
NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); | ||
#endif | ||
NSArray<NSString *> *components = @[ paths.lastObject, @"Google/FIRApp" ]; | ||
NSString *directoryString = [NSString pathWithComponents:components]; | ||
NSURL *directoryURL = [NSURL fileURLWithPath:directoryString]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It seems like this condition appears in the code enough times to justify creating a method in core or google utilities to encapsulate it. Not necessary should be a part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a reasonable idea, I do hesitate because I also want to make sure people are making intentional decisions about where they store things and recognize that this could be writing to a cache. Ideally I'd like to see this pop up in danger or something - if you're running tvOS tests and the active target has the
NSApplicationSupportDirectory
symbol, throw a warning/error.