Bjarke
Bjarke

Reputation: 1295

Xamarin and android pushmesages

I am trying to implement pushmesages for my xamarin android app. I have installed xamarin google play service version 26 via nuget. However when I call this

int resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this);

I get a method not found exception. Any help is highly appreciated

Upvotes: 2

Views: 540

Answers (2)

Arthur Thompson
Arthur Thompson

Reputation: 9225

try:

GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
  ...
}

Upvotes: 0

Adrien Cerdan
Adrien Cerdan

Reputation: 1015

To check if GooglePlayServices are available, use :

int resultCode = GooglePlayServicesUtil.IsGooglePlayServicesAvailable (this);

Did you follow this guide ?

https://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/android/remote_notifications_in_android/

Upvotes: 1

Related Questions