Пример #1
0
 public async Task Post(JObject data)
 {
     await PushNotificationsService.NotifyVehicleRequestedAsync
     (
         data.GetValue("employeeId").Value <string>(),
         data.GetValue("driverId").Value <int>(),
         data.GetValue("latitude").Value <double>(),
         data.GetValue("longitude").Value <double>()
     );
 }
Пример #2
0
 public void RegisterTypes(IContainerRegistry containerRegistry)
 {
     containerRegistry.RegisterSingletonFromDelegate <IPushNotificationsService>(provider =>
     {
         var service = new PushNotificationsService(
             provider.GetRequiredService <IPlatformClient>(),
             provider.GetRequiredService <ILoggerFactory>());
         service.AddInitializer(provider.GetService <IPushNotificationInitializer>());
         return(service);
     });
 }
Пример #3
0
        public static async Task SendSettingsToServerAsync()
        {
            var pns = new PushNotificationsService();

            if (!pns.IsRegistered)
            {
                await pns.RegisterAsync();

                await pns.RequestTokenIfNeededAsync();
            }

            await pns.UpdatePushChannelIfNeeded();

            await pns.UpdateUserPreferencesIfNeededAsync();
        }
 public async Task PostNotifyArrival(JObject data)
 {
     await PushNotificationsService.NotifyVehicleArrivedAsync(data.GetValue("employeeId").Value <string>());
 }
Пример #5
0
 public async Task Post(JObject data)
 {
     await PushNotificationsService.NotifyApprovedRequestAsync(data.GetValue("employeeId").Value <string>());
 }