React Native with Asp.net Core Web Api

Viewed 7821

I have developed asp.net core web project,

Which is working perfect.

Now i want to extend my dot net with web api and then i want to build mobile app with react native.

I have searched a lot for react native with asp.core web api sample.

But i couldn't find any. I don't know whether it is good to use react native with asp.net core or not.

Please if any body has any git repo or any good guide for that refer me.

Thanks

2 Answers

I'm embarking on the same path at the moment. I have a website written in React JS and want to add apps using React Native. All the services are working and in place, so as such it will be possible to write React Native apps (many converted over from React JS by hand). All I need to do then is to call my dotnet core Restful Apis and happy days. I envisage no real issues with the approach.

The link https://rapidapi.com/blog/how-to-make-rest-api-calls-in-react-native/ shows how to call the api from React Native and I am sure there are countless other examples to follow. All these should be fairly straightforward.

IF anyone know a better approach please advise as I am eager to pick the best route through this.

The best I can think of is the .NET Core 3 + React template that you can find when creating a project in Visual Studio. You can add authorization and it will be ready to use both in React and .NET (OidController).

enter image description here

enter image description here

It's a very good template. I can also recommend the Angular version as well. The only thing that is missing is the refresh token upgrade (it uses JWT access token) and you should add some more code to Identity to use a refresh token (you need a refresh token to generate new access token if your bearer token expires after 20-30 minutes AFK on the website).

Related