-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add react native web support #13
base: main
Are you sure you want to change the base?
Conversation
c309c37
to
bd56e18
Compare
@Robert27 thank you for your contribution. Can you please highlight in a comment here the differences in implementation between the two and the reasoning for explicit support for React Native Web? |
React Native Web has become increasingly popular, especially since Expo Web. The Bluesky web app, for example, is written with React Native Web. Specifically, I need this feature for my team, and I read the request in the discord. However, this SDK does not yet support the web platform. Implementing it turned out to be a bit more complicated, as different philosophies were chosen between native and web. |
} | ||
return ["iOS", Platform.Version]; | ||
default: | ||
return ["", ""]; |
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.
Maybe we can add web client here as well?
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.
If I remember correctly I left this empty as the server auto generates the operating system using the User Agent.
I'll double check it later.
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.
sorry, wrong place for a comment, I meant just to add another case in switch and return web client information
I can absolutely relate on this PR. |
const dispatcher = | ||
Platform.OS === "web" | ||
? new WebEventDispatcher(appKey, baseUrl, env) | ||
: new NativeEventDispatcher(appKey, baseUrl, env); |
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.
Since we've had trouble in the past with automatically detecting environments
(like in aptabase/aptabase-swift#24 aptabase/aptabase-swift#27 )
I'm a bit reluctant to go this same path.
@Robert27 what are your thoughts and enabling the WebEventDispatcher
only if a new, explicit option is set in options: AptabaseOptions
Would avoid breaking existing usages that simply upgrade, and would enable new integrations to explicitly opt in.
Added support for react native web by adapting the dispatcher behavior from
aptabase-js
.react-native
, that is why every test file fails if a react native import is present in the parent. :/@ivnbogdan
Resolves #12