Exemplo n.º 1
0
        public static bool UseOneSignalPush(this IServiceCollection services,
                                            Type delegateType,
                                            OneSignalPushConfig config)
        {
#if __ANDROID__ || XAMARIN_IOS
            services.AddSingleton(config);
            services.TryAddSingleton <PushContainer>();
            services.TryAddSingleton(typeof(IPushManager), typeof(Shiny.Push.OneSignal.PushManager));
            services.AddSingleton(typeof(IPushDelegate), delegateType);
            return(true);
#else
            return(false);
#endif
        }
Exemplo n.º 2
0
 public static bool UseOneSignalPush <TPushDelegate>(this IServiceCollection services, OneSignalPushConfig config)
     where TPushDelegate : class, IPushDelegate
 => services.UseOneSignalPush(
     typeof(TPushDelegate),
     config
     );