Created
March 14, 2018 17:43
-
-
Save jamesmontemagno/47a90b3886625ef4eadda10e77b0c530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool IsPlayServicesAvailable () | |
{ | |
int resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable (this); | |
if (resultCode != ConnectionResult.Success) | |
{ | |
if (GoogleApiAvailability.Instance.IsUserResolvableError(resultCode)) | |
{ | |
var dialog = GooglePlayServicesUtil.GetErrorDialog(resultCode, | |
this, | |
ConnectionFailureResolutionRequest); | |
if (dialog != null) | |
{ | |
var errorDialog = new ErrorDialogFragment { Dialog = dialog }; | |
errorDialog.Show(SupportFragmentManager, "Google Services Updates"); | |
return false; | |
} | |
} | |
else | |
{ | |
//error | |
} | |
return false; | |
} | |
else | |
{ | |
Settings.Current.PushNotificationsEnabled = true; | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment