Web3-React: Walletconnect does not set active and account in useWeb3React hook - reactjs

Bug Description
The issue is that when I use walletconnect to connect, I get the walletconnect qr modal to open fine. The modal also closes when the qr code is scanned from and connected from trustwallet and metamask app on my android phone. But I am console logging the account and active variables from useWeb3React hook, and they come up as undefined.
This is not the problem with injected as I can see the account and active is also set as true after I connect.
Reproduction
Codesandbox Link
Expected Behavior
Active is set to true and account is set to wallet address

I was able to connect with WalletConnect to your reproduction app using Metamask and TrustWallet from my Android device, and from a Desktop app (Infinity Wallet), so your code is fine.
Screenshot of connection.
Double check that you're connecting correctly in the Android app (hit connect), and that your accounts are legit (e.g. fully signed-up, security setup, etc.). Having a balance in your accounts doesn't matter.
Import error and setError from useWeb3React along with the others you're already importing. Use setError where you think the issue might be happening, then display it using error similarly to how you're displaying active.

Related

error handling for nextjs typesense instant-search-hooks app

Currently I'm trying to setup a nextjs app with firebase as backend. Because firebase cant handle a fulltext search, I want to use typesense. They provide a really nice documentation how to set it up: https://typesense.org/docs/guide/firebase-full-text-search.html
For typesene I already set up docker containers for all my 3 environment (the docker typesense provides). To request information back from the docker I use the typesense-instantsearch-adapter- npm Package. In the app I have different user roles, so not everyone can see all indexed data - therefore I use a scoped search which is possible through the apiKey I generate when the users logs in (scoped api key). The apiKey therefore is variable depending on the user and the user role. My current setup works fine and also the search is already working.
The only problem I have is, that I cannot catch the errors the <InstantSearch>-Component is throwing. For example if the docker is offline or if the generated apiKey is not valid.
I tried multiple solutions, but could not find a proper solution:
Error boundary around the component (react docu)
Error boundary npm package
Try/catch block around the component
I found a codesandbox that has a quit similar setup. The sandbox is using algolia instead of typesense, but the error that pops up is the same: https://codesandbox.io/s/fib6jm?file=/App.tsx:1043-1056
Go to App.tsx
line 38
remove string
Uncaught, unspecified "error" event. ([object Object]) pops up
How can I catch / access this error to reroute or show an error screen?

Test Suite for Smart Home don't execute action

I am trying to execute Test Suite to certify, but I receive an error when executing the action. I can't find anything in the Google Cloud log. Everything works fine using Google Assistant on my phone and Nest.
enter image description here
A 503 error code means that the requested service is temporarily unavailable at the moment. You can wait for some time before trying again & make sure that your Smart Home Actions are linked with an account & testing is enabled for your actions. For instructions on how to set up your account for testing, check this link.
If the issue still persists, open up a ticket on our Public Issue Tracker.

Branch.io referral implementation not working in web app

I am using branch SDK in the mobile app for which I am working on for more than 2 years now. I want to have the referral feature in our web application as well. I have followed the web app integration guidelines and has integrated branch in my app. I am using v2.54.2 of branch SDK and v16.13.1 of React.
I am facing a strange issue after integrating. I am calling the branch.logout() method while the user logs out of the application. But after the user logs in back (either to the same user account or to a different user account in our application), none of the branch functionalities work. (branch.setIdentity(), branch.credit(), branch.redeem() etc.). I am getting the following error in the console
Uncaught Error: Invalid JSON string: [object Object]
at ia (build.min.js?cd67:7)
at d (build.min.js?cd67:57)
at Mb (build.min.js?cd67:57)
at eval (build.min.js?cd67:146)
at eval (build.min.js?cd67:135)
at k (build.min.js?cd67:66)
at XMLHttpRequest.Sb.g.onreadystatechange (build.min.js?cd67:64)
I’m not even able to identify which method is causing this error. The branch APIs won’t work even if I do a hard reload. After days of debugging what I found is all the functionalities will work if I open the app in a new tab and close the current tab. But if the user logout and login from the new tab, the issue comes back.
What I suspect is the global branch object, while logging out is not getting reset to the initial state. Can anyone please help me with this issue? I am stuck with this issue for more than 2 weeks now

how to send email directly in React Native App

I am progromming about function: send Email to gmail Address directly from React native App.
I searched on Internet and try library: https://github.com/anarchicknight/react-native-communications, https://github.com/chirag04/react-native-mail.
Howerver, they only show me view of Gmail App which I installed in my device.
I want react native app will send directly to Address Email.
My device I tested run on Android Platform.
Thank you so much
You need an email server or an email services to send an email, there is no way you can send an email directly from the client side.
There are several of them in the internet, you can try: MailGun or SendPulse, they got some good free tiers.
Your job is just calling a simple POST method from your app to their APIs.
I have tried, and so far succeeded in testing with iOS, with react-native-email ("npm install react-native-email").
There is a bit of fluffing around when sending the first email as you have to "login" to your email account. But otherwise, test emails are going through fine.
Also, SendPulse is a bulk newsletter service, not for individual emails.
One annoying caveat: it won't work in your emulator. It will return a URL error when you click the send button. But it works fine on a real device. I'm using Expo (and who wouldn't) and it works fine on my iPhone.
Complete code for testing purposes here: https://github.com/tiaanduplessis/react-native-email

How to reproduce UserRecoverableAuthIOException on Android device?

When I debug with Google Drive API, I met this problem:
First time when I call service.about().get().execute(); in my app, it will catch UserRecoverableAuthIOException and my code call startActivity.
But after I confirm the auth dialog , it never show up again.
I want to debug the whole auth routine, but how to erase auth data and let it raise the exception again?
Just unconnect the app from where the Google service you use, such as the "Manage apps" setting in Google Drive webpage.
Go to https://accounts.google.com/IssuedAuthSubTokens to revoke access of the app and expect the exception again.

Resources