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