Skip to content

Would there be an advantage to moving the service setups from MainActivity and AppDelegate to the App class constructor?  #222

@rs-mobitech

Description

@rs-mobitech

I see in the Android MainActivity and the iOS AppDelegate you have the same code:

        var themeService = ContainerService.Container.Resolve<ThemeService>();
        var languageService = ContainerService.Container.Resolve<LanguageService>();
        var splashScreenPage = ContainerService.Container.Resolve<SplashScreenPage>();
        var analyticsService = ContainerService.Container.Resolve<IAnalyticsService>();
        var notificationService = ContainerService.Container.Resolve<NotificationService>();
        var deviceNotificationsService = ContainerService.Container.Resolve<IDeviceNotificationsService>();

        LoadApplication(new App(themeService, languageService, splashScreenPage, analyticsService, notificationService, deviceNotificationsService));

Would it better if this were moved to the constructor of the App class instead?

Just wondering why you chose to do it this way and if there is any advantage to doing it the way that you did?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions