Beispiel #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>()
     );
 }
Beispiel #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);
     });
 }
        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>());
 }
Beispiel #5
0
 public async Task Post(JObject data)
 {
     await PushNotificationsService.NotifyApprovedRequestAsync(data.GetValue("employeeId").Value <string>());
 }