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
Unable to get client without fragment activity context #112
Comments
@marius-zilinskas-tg I had the same problem and simply changed the parent to FragmentActivity, and everything seems to work ok. Did you experience any problems with this approach? |
It does solve the problem, however, I think this should be addressed from the SDK and not the client. I would like to avoid using FragmentActivity as a parent just because of one SDK. |
According to my vision/understanding, for Jetpack API it will be nice if SDK exposes So it can be used like this
@marius-zilinskas-tg @vladd-g could you please share your vision, how is the perfect integration looks for you? |
@CAMOBAP Yes, your proposed solution looks nice |
I am having the same problem when I tried with Hilt, please take a look to the code below
|
@gilsonjuniorpro Unfortunately SDK based on |
Thank you, so using any version below 3.9.0 it works with hilt without asking for the FragmentActivity |
@gilsonjuniorpro it works only because you actually pass FragmentActivity or Activity that extends it. This is why we decided to make them explicit in API to avoid confusion. |
Yeah, make sense, thanks for your help |
Are there any updates regarding this? How does one use it in Compose without an Activity? |
@Sophon no update yet, work in progress |
HCaptcha.getClient(context) casts context to FragmentActivity. If application is written with Jetpack Compose - fragment activity can not be provided.
How to get HCaptcha client when fragment activity context can not be provided?
The text was updated successfully, but these errors were encountered: