-
Notifications
You must be signed in to change notification settings - Fork 11
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
call private ios pages API #69
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.
Hmm, Reece made a good point about compatibility with different versions. Some comments inline.
ios/FullStory.mm
Outdated
dispatch_async(dispatch_get_main_queue(), ^{ | ||
self->_page = [FS pageWithName:pageName properties:pageProperties]; | ||
[FS pageViewWithNonce:uuid name:pageName properties:pageProperties]; |
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.
This comment in the related Android PR reminded me that this could be a problem if paired with a plugin that does not have pageViewWithNonce
. We presumably either need to check the plugin version -- or we need to check this with something like:
[FS pageViewWithNonce:uuid name:pageName properties:pageProperties]; | |
if (![FS respondsToSelector:@selector(pageViewWithNonce:name:properties:)]) { | |
...react native logging mechanism to complain... | |
} else { | |
[FS pageViewWithNonce:uuid name:pageName properties:pageProperties]; | |
} |
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.
Added a check
5526414
to
bcc384c
Compare
d5a88de
to
bd11bf6
Compare
@@ -35,7 +35,7 @@ public class FullStoryModuleImpl { | |||
updatePageProperties = null; | |||
endPage = null; | |||
Log.println(Log.ERROR, NAME, "Unable to access native FullStory pages API. Pages API will not function correctly. " + | |||
"Make sure that your plugin is at least version 1.38; if the issue persists, please contact FullStory Support."); | |||
"Make sure that your plugin is at least version 1.41; if the issue persists, please contact FullStory Support."); |
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.
Bumped this Android message to 1.41
since we edited the iOS
private API's made available in 1.41
. We want the recommended version for Pages API to be consistent.
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.
This check and informative log message is Android-specific. We should have a similar check and log message for iOS.
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.
The error message PagesAPIError
in ios/FullStory.mm
serves this purpose. Not sure if you missed it or if you mean something else?
- update legacy RN native module method declarations - replace System.out with android.util.Log - initialize reflected methods once - getUUID is async - fix page properties merge - add TS FSPage types
807b50d
to
984484e
Compare
a430578
to
4c41df2
Compare
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.
LGTM, but I'll let @jwise approve as its iOS.
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 for pointing out that iOS log message - I think it's because I was skimming for an "Unable to access pages" type of message and didn't see it. So, consider a couple of small string changes, but otherwise looks good!
ios/FullStory.mm
Outdated
}); | ||
} | ||
if (![FS respondsToSelector:@selector(_updatePageWithNonce:properties:)]) { | ||
RCTLogError(PagesAPIError, @"endPage"); |
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 "endPage" should be "updatePage" here.
ios/FullStory.mm
Outdated
} | ||
|
||
NSString *const PagesAPIError = @"Unable to call %@. Make sure that your plugin is at least version 1.41; if the issue persists, please contact FullStory Support."; |
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.
Could you add some verbiage similar to the Android log, like "Unable to access native FullStory pages API. Pages API will not function correctly. "
. This will help the clarity of the log message and the consistency between platforms.
* add pages API to JS spec * add pages API to iOS * add Android pages API * Add Android pages implementation (#68) * Add Android pages implementation * updates on feedback - update legacy RN native module method declarations - replace System.out with android.util.Log - initialize reflected methods once - getUUID is async - fix page properties merge - add TS FSPage types * cleanup and fix turbomodule * remove private functions from export * remove page methods from types * add error message * generate UUID with Math.random() * remove async method * update method type to synchronous * update android log --------- Co-authored-by: Ryan Wang <[email protected]> * call private ios pages API (#69) * Add Android pages implementation * updates on feedback - update legacy RN native module method declarations - replace System.out with android.util.Log - initialize reflected methods once - getUUID is async - fix page properties merge - add TS FSPage types * cleanup and fix turbomodule * remove private functions from export * remove page methods from types * add error message * generate UUID with Math.random() * remove async method * update method type to synchronous * implement ios pages API * formatting * formatting * Fix rebase regression * Edit error message --------- Co-authored-by: Ryan Wang <[email protected]> * Improve Pages types and add testing (#76) Co-authored-by: Ryan Wang <[email protected]> * use uppercase UUIDs, exclude lib/ from jest * implement new uuid generator, update tests --------- Co-authored-by: Ryan Wang <[email protected]>
With the following JS code:
Old RN Architecture:
https://app.staging.fullstory.com/ui/KWH/session/4688480919289856:4741929862889472
New RN Architecture:
https://app.staging.fullstory.com/ui/KWH/session/4688480919289856:6558104800395264
* Fix TS types* Fix immutable object merge issue (Old Architecture)* Fix Java method declaration on Old Architecture