6

I have developed an ASP.NET Core web project, which is working perfectly.

Now I want to extend and create an ASP.NET Core Web API, and then I want to build mobile app with react native.

I have searched a lot for react native with ASP.NET Core Web API sample, but I couldn't find anything.

I don't know whether it is good to use react native with ASP.NET Core Web API, or not.

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

Thanks

2
  • Check my answer and tell me if you need more information. I recommend you the default template. It's a good starting point Commented Jun 30, 2020 at 15:23
  • Did you end up finding anything useful? Commented Sep 24, 2020 at 16:44

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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).

2 Comments

i know about react + dotnet core..i want to know about react native + dotnet core. Will dot net web api work same as for reactjs
@KashifYounus The .NET Core project will work with Native as well, but you will have to rewrite some of the react code or at least tweak it a little. As I said it's a good start to learn how to use .NET Core with it. For more info about React Native + .NET Core go here (it has the configuration for Native and all): reactjs.net/tutorials/aspnetcore.html#install-a-js-engine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.