Skip to content

Instantly share code, notes, and snippets.

@jamesmontemagno
Created March 14, 2018 17:43
Show Gist options
  • Save jamesmontemagno/47a90b3886625ef4eadda10e77b0c530 to your computer and use it in GitHub Desktop.
Save jamesmontemagno/47a90b3886625ef4eadda10e77b0c530 to your computer and use it in GitHub Desktop.
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