private async void RetrieveToken() { try { IFCMDetails fcmDetails = DependencyService.Get <IFCMDetails>(); string token = await fcmDetails.GetAppToken(); FireBaseToken = token; System.Diagnostics.Debug.WriteLine("FCM Token is " + token); } catch { //await Application.Current.MainPage.DisplayAlert("Notification Error", "Error in generating firebase token", "ok"); } }
private async Task <string> RetrieveToken() { string token = ""; try { IFCMDetails fcmDetails = DependencyService.Get <IFCMDetails>(); token = await fcmDetails.GetAppToken(); System.Diagnostics.Debug.WriteLine("FCM Token is " + token); } catch (Exception ex) { Console.Write(ex.Message); //await Application.Current.MainPage.DisplayAlert("Notification Error", "Error in generating firebase token", "ok"); } return(string.IsNullOrEmpty(token) ? "" : token); }