Skip to content

Commit 33256a6

Browse files
committed
Release 2.0.1
2 parents a9910f9 + 8c41ac6 commit 33256a6

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

CHANGELOG.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
## 2.0.1
2+
3+
* No longer rely on the Activity object when this plugin is instantiated.
4+
15
## 2.0.0
26
* Move from swift to Objective-C and from Kotlin to Java
37

4-
## 1.0.6
8+
## 1.0.6+1
9+
* Revert the breaking 1.0.6 update. 1.0.6 was known to be breaking and should have incremented the major version number instead of the minor. This revert is in and of itself breaking for anyone that has already migrated however. Anyone who has already migrated their app to AndroidX should immediately update to 2.0.0 instead. That's the correctly versioned new push of 1.0.6.
10+
11+
## 1.0.6
12+
* **BAD.** This was a breaking change that was incorrectly published on a minor version upgrade, should never have happened. Reverted by 1.0.6+1.
513

6-
* Fixes a small issue caused by compiling against master build of Flutter.
14+
"**Breaking change.** Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library."
715

816
## 1.0.5
17+
* **BAD.** This was a breaking change that was incorrectly published on a minor version upgrade, should never have happened. Reverted by 1.0.6+1.
918

10-
* Update Kotlin version and added support for Android X;
11-
* Update static code analysis options to confirm to the latest recommendations from the Flutter team.
19+
"**Breaking change.** Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library."
1220

1321
## 1.0.4
1422

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To use this plugin, add `google_api_availability` as a [dependency in your pubsp
1919

2020
```yaml
2121
dependencies:
22-
google_api_availability: '^1.0.6'
22+
google_api_availability: '^2.0.0'
2323
```
2424
2525
> **NOTE:** There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. See issue [Flutter#16049](https://github.com/flutter/flutter/issues/16049) for help on integration.

android/src/main/java/com/baseflow/googleapiavailability/GoogleApiAvailabilityPlugin.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.baseflow.googleapiavailability;
22

33
import android.app.Activity;
4+
import android.content.Context;
45

56
import com.google.android.gms.common.ConnectionResult;
67
import com.google.android.gms.common.GoogleApiAvailability;
@@ -47,24 +48,28 @@ public class GoogleApiAvailabilityPlugin implements MethodCallHandler {
4748

4849
public static void registerWith(Registrar registrar) {
4950
final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter.baseflow.com/google_api_availability/methods");
50-
channel.setMethodCallHandler(new GoogleApiAvailabilityPlugin(registrar.activity()));
51+
channel.setMethodCallHandler(new GoogleApiAvailabilityPlugin(registrar.context()));
5152
}
5253

53-
private final Activity activity;
54+
private final Context context;
5455

55-
private GoogleApiAvailabilityPlugin(Activity activity) {
56-
this.activity = activity;
56+
private GoogleApiAvailabilityPlugin(Context context) {
57+
this.context = context;
5758
}
5859

5960
@Override
6061
public void onMethodCall(MethodCall call, Result result) {
6162
if (call.method.equals("checkPlayServicesAvailability")) {
6263
final Boolean showDialog = call.argument("showDialog");
6364
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
64-
final int connectionResult = googleApiAvailability.isGooglePlayServicesAvailable(activity);
65+
final int connectionResult = googleApiAvailability.isGooglePlayServicesAvailable(context);
6566

66-
if (showDialog != null && showDialog) {
67-
googleApiAvailability.showErrorDialogFragment(activity, connectionResult, REQUEST_GOOGLE_PLAY_SERVICES);
67+
68+
if (context instanceof Activity) {
69+
Activity activity = (Activity) context;
70+
if (showDialog != null && showDialog) {
71+
googleApiAvailability.showErrorDialogFragment(activity, connectionResult, REQUEST_GOOGLE_PLAY_SERVICES);
72+
}
6873
}
6974

7075
final int availability = toPlayServiceAvailability(connectionResult);

ios/google_api_availability.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'google_api_availability'
6-
s.version = '2.0.0'
6+
s.version = '2.0.1'
77
s.summary = 'A Flutter plugin to check the availability of Google Play Services on an Android device.'
88
s.description = <<-DESC
99
A Flutter plugin to check the availability of Google Play Services on an Android device.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: google_api_availability
22
description: A Flutter plugin to check the availability of Google Play Services on an Android device.
3-
version: 2.0.0
3+
version: 2.0.1
44
authors:
55
- Baseflow <[email protected]>
66
- long1eu <[email protected]>

0 commit comments

Comments
 (0)