abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.48k stars 3.35k forks source link

ABP framework + Angular + React Native #17338

Open manhhuycao opened 11 months ago

manhhuycao commented 11 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

I'm try use ABP framework + Angular + React Native to build my project. Angular use https for connect APIs but React Native use http.

Can I change method https for React Native or http for Angular?

Describe the solution you'd like

I try config class "HttpApi.Host" but it not work :(

public override void PreConfigureServices(ServiceConfigurationContext context) { PreConfigure(builder => { builder.AddValidation(options => { options.AddAudiences("Hrm"); options.UseLocalServer(); options.UseAspNetCore();

        });
        builder.AddServer(options => { options.UseAspNetCore().DisableTransportSecurityRequirement(); });

    });

if DEBUG

    PreConfigure<OpenIddictServerBuilder>(options =>
    {

        options.UseAspNetCore()
            .DisableTransportSecurityRequirement();
    });

endif

}

Additional context

No response

manhhuycao commented 11 months ago

i screenshort my code in "HttpApi.Host"

image

mahmut-gundogdu commented 11 months ago

React uses http because emulator/simulator had issue working with self-signed issues.

image

source: https://docs.abp.io/en/abp/latest/Getting-Started-React-Native

so you can find a solution for self-signed certification on emulator. You can use https. it is not related abp.

but you can use angular with http, in dev mode.

change: url on environment.ts change: urls in appsettings.json (host project, for cors)

image
manhhuycao commented 10 months ago

Dear @mahmut-gundogdu Can i use 1 C# backend for both projects Angular & ReactNative? i try setup follow your guide but React Native dont run with https :(

mahmut-gundogdu commented 10 months ago

Dear @mahmut-gundogdu Can i use 1 C# backend for both projects Angular & ReactNative? i try setup follow your guide but React Native dont run with https :(

Like I said, It is related with mobile development. Native IOS and Android developer has same limitations. Self-signed certification is a issue. You may deploy your backend on url with valitd https certification. like test-env.yourcompany.com. Then you uses the link.

or you can investicate is there any workaround for self-signed certification. it is not related for ABP even not related with React Native. It related to Native development.