-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Local FID generating #3157
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
Local FID generating #3157
Conversation
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.
Please improve the comment I referenced - then LGTM
|
||
// TODO: Consider implementation which does not modify UUID. | ||
|
||
// A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5 |
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.
16.5 what?
// TODO: Consider implementation which does not modify UUID. | ||
|
||
// A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5 | ||
// Our generated ID has 16 bytes UUID + 1 byte prefix which is 23 base64 characters |
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.
16+1=23???
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.
That's how base64 encoding works.
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.
Updated the explanation a bit. Let me know if it is still not exactly clear.
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.
Thanks! That clarifies it.
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.
Thanks!
@class FIRInstallationsItem; | ||
|
||
/** | ||
* The class is responsible for managing FID for a given `FIRApp`. |
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.
you mean managing FIRInstallationsStore? Because I don't see any local cached FID info. Or should we have a local cached FIRInstallationsItem so we are not reconstruct the object every query.
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.
@chliangGoogle
By managing I mean following:
- retrieving /saving locally stored FID
- registering a new FID using FIS API
- removing FID
The class is not fully implemented yet, it is just an intermediate part without API (sorry, forgot to add a TODO for that).
I'll add more description on the FID lifecycle to the class description later on, so it will be more clear.
|
||
- (instancetype)initWithGoogleAppID:(NSString *)appID appName:(NSString *)appName; | ||
|
||
- (FBLPromise<FIRInstallationsItem *> *)getInstallationItem; |
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 don't see it gets called from FIRInstallations so I wonder if we should have a test app that triggers the public API which calls all the new methods you created. Otherwise, it's hard to vision what this new created method for without seeing it called any where from the public API chain. I think it might help us to have a end-to-end flow during development.
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.
It is called from here. Yeah it may be easy to miss.
A test app is in my TODO list. I assume it will be used for manual and automated testing. I think to add it when there is something to test end-to-end.
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.
aha, right it's moved from another class. Got it
|
||
- (instancetype)initWithGoogleAppID:(NSString *)appID appName:(NSString *)appName; | ||
|
||
- (FBLPromise<FIRInstallationsItem *> *)getInstallationItem; |
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.
aha, right it's moved from another class. Got it
No description provided.