Skip to content

Add GULUserDefaults to GoogleUtilities. #1812

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

Merged
merged 4 commits into from
Sep 14, 2018
Merged

Add GULUserDefaults to GoogleUtilities. #1812

merged 4 commits into from
Sep 14, 2018

Conversation

ryanwilson
Copy link
Member

This is a workaround for NSUserDefaults crashing when setting values
in the background in some situations on iOS 11. This uses the C API
in order to avoid an NSNotification firing (which a class eventually
tries to update the UI from the thread that set the value).

This is a workaround for NSUserDefaults crashing when setting values
in the background in some situations on iOS 11. This uses the C API
in order to avoid an NSNotification firing (which a class eventually
tries to update the UI from the thread that set the value).
@ryanwilson ryanwilson added this to the M34 milestone Sep 13, 2018
@ryanwilson
Copy link
Member Author

Will wait until Travis is green before adding reviewers.


@interface GULUserDefaults ()

///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops nice catch, will fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

CFStringRef _appNameRef;
}

+ (nonnull GULUserDefaults *)standardUserDefaults {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just use the NS_ASSUME_NONNULL for this file and others?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good call! Actually just caught an issue there too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

@paulb777
Copy link
Member

From travis, it looks like it doesn't work on macOS

@ryanwilson
Copy link
Member Author

@bstpierr Travis is green and I addressed your comments. PTAL when you get a chance! :)

GULUDMessageCodeInvalidKeySet = 2,
GULUDMessageCodeInvalidObjectSet = 3,
GULUDMessageCodeSynchronizeFailed = 4,
GULUDMessageCodeLibraryDirNotFound = 5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It looks like this message code is never used. Not sure if this was used in a previous commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Fixed.

@ryanwilson ryanwilson merged commit ed30bc9 into master Sep 14, 2018
@ryanwilson ryanwilson deleted the rw-userdefaults branch September 14, 2018 15:59
renkelvin added a commit that referenced this pull request Sep 14, 2018
@firebase firebase locked and limited conversation to collaborators Oct 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants