Activities of "LiSong"

Question
  • ABP Framework version: v8.1.0
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Does it have an event mechanism? For example, when a user confirms their email through email confirmation, and the system changes the user's email confirmed status from False to True, I want to add a feature that sends a welcome message to the user or changes the user's role after the email is confirmed.

I want to use the event like this:

  1. Create an event handler to handle the EmailConfirmedEvent:
public class EmailConfirmedEventHandler : ILocalEventHandler<EmailConfirmedEvent>, ITransientDependency
{
    public Task HandleEventAsync(EmailConfirmedEvent eventData)
    {
        // Code to send a welcome message or change user role
        SendWelcomeMessage(eventData.UserId);
        ChangeUserRole(eventData.UserId);

        return Task.CompletedTask;
    }

    private void SendWelcomeMessage(Guid userId)
    {
        // Implementation of sending a welcome message
    }

    private void ChangeUserRole(Guid userId)
    {
        // Implementation of changing user role
    }
}
  1. Register the event handler in the module's ConfigureServices method:
public override void ConfigureServices(ServiceConfigurationContext context)
{
    context.Services.AddTransient<ILocalEventHandler<EmailConfirmedEvent>, EmailConfirmedEventHandler>();
}

when the user confirms their email, the system will use the event mechanism to send a welcome message or change the user's role,

But I am not sure if abp has EmailConfirmedEvent so that I can use like this or does it have a similar mechanism?

Thanks

Answer

hi, can anyone answer my questions here?

Answer

yes, I have done it, after I changed these, I could see the auth login page with username and password, it allowed me to log in, but it showed those errors after I logged in but if you check my environment.js, I am using remote auth server and api host, they are hosted in Azure app services

by the way this is for dev/local environment settings, is there a doc for production settings? https://docs.abp.io/en/commercial/8.0/getting-started-react-native#configure-your-local-ip-address

Answer

I can run it now, but after I logged in with username and password, I got this error:

WARN Possible Unhandled Promise Rejection (id: 6): SyntaxError: JSON Parse error: Unexpected EOF parse@[native code] tryCallOne@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25627:16 http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25708:27 http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26603:26 _callTimer@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26522:17 _callReactNativeMicrotasksPass@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26552:17 callReactNativeMicrotasks@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26715:44 __callReactNativeMicrotasks@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20131:46 http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19943:45 __guard@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20115:15 flushedQueue@http://192.168.1.245:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19942:21 flushedQueue@[native code] invokeCallbackAndReturnFlushedQueue@[native code]

here is my environment.js:

const yourIP = '192.168.1.245'; // See the docs https://docs.abp.io/en/abp/latest/Getting-Started-React-Native?Tiered=No const port = 44305; //const apiUrl = http://${yourIP}:${port}; const apiUrl = 'https://api.azurewebsites.net/';

const ENV = { dev: { apiUrl, appUrl: exp://${yourIP}:19000, oAuthConfig: { issuer: 'https://auth.azurewebsites.net', clientId: 'Trust_Mobile', scope: 'offline_access Trust', }, localization: { defaultResourceName: 'Trust', }, }, prod: { apiUrl, appUrl: exp://${yourIP}:19000, oAuthConfig: { issuer: 'https://auth.azurewebsites.net', clientId: 'Trust_Mobile', scope: 'offline_access Trust', }, localization: { defaultResourceName: 'Trust', }, }, };

export const getEnvVars = () => { // eslint-disable-next-line no-undef return DEV ? ENV.dev : ENV.prod; };

Answer

May I ask about the approximate release date?

Answer
"expo": "^47.0.0",

This version is too low, the new Expo Go app does not support it, can you upgrade it?

Answer

which expo version are you using?

I get this error if the client secret is empty Auth ErrorTypeError: Failed to fetch

  • ABP Framework version: v8.0.5
  • UI Type: Angular / MVC / Blazor WASM / Blazor Server
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

What's the client_secret for the swagger ui? by the default the appsettings doesn't have a client_secret for it? I checked the openiddict/applications page, it is a public client but it doesn't work if I leave it blank

Question
  • ABP Framework version: v8.0.5
  • UI Type: MVC
  • Database System: EF Core (SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I am trying to run the react native app on my iphone and android simulator, both are failed with there errors ERROR TypeError: _ReanimatedModule.default.createNode is not a function (it is undefined), js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

are you still maintaining the react native app?

Showing 1 to 10 of 11 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35