Gth6
Gth6

Reputation: 43

How to Retrieve Real-Time Verification Status Updates in a React Native App

Our backend receives a webhook with a verification status of either true or false. The mobile app needs to retrieve this status, which may be available immediately, or it may take several minutes or even days.

What is the best practice for retrieving this status from the mobile app? One approach that I am considering is to use an interval to poll the backend every x seconds (e.g. 15 seconds) and check if the status has changed to true. If it has, then I can stop the polling. If the user quits the app, I can resume polling when they return.

Another option is to use a WebSocket to reduce the number of HTTP requests to the backend.

What are your thoughts on these approaches?

I tried the 1st approach and it works, but is it good method?

Upvotes: 0

Views: 123

Answers (0)

Related Questions