diff --git a/CHANGELOG.md b/CHANGELOG.md index efb62f6..427f2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.2 + +- Fix issue with AndroidX + ## 2.0.1 - Fix formatting of plugin diff --git a/README.md b/README.md index c5ff629..797af20 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A plugin to use Pushe sdk in Flutter framework. ### Run the sample -Run: `git clone https://github.com/pusheco/flutter-sample.git`
+Run: `git clone https://github.com/pusheco/pushe-flutter.git`
The go to example: `cd example`
And run the example on a connected device: `flutter run`
@@ -34,8 +34,8 @@ Go to https://console.pushe.co , create an application with the same package nam In your `main.dart`: ```dart -import 'package:pushe/pushe.dart'; +import 'package:pushe_flutter/pushe.dart'; ``` ## More Info -For more details, visit [HomePage docs](https://pushe.co/docs/flutter/) or the [Wiki](https://github.com/pusheco/flutter-sample/wiki/Docs) +For more details, visit [HomePage docs](https://docs.pushe.co/) diff --git a/android/build.gradle b/android/build.gradle index e4c43da..ca28821 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,7 +27,6 @@ android { defaultConfig { minSdkVersion 16 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' diff --git a/android/src/main/java/co/pushe/plus/flutter/PusheApplication.java b/android/src/main/java/co/pushe/plus/flutter/PusheApplication.java index a28af7d..1e9eeb2 100644 --- a/android/src/main/java/co/pushe/plus/flutter/PusheApplication.java +++ b/android/src/main/java/co/pushe/plus/flutter/PusheApplication.java @@ -4,7 +4,6 @@ import android.content.Intent; import android.os.Handler; import android.os.Looper; -import android.support.annotation.NonNull; import android.util.Log; import android.util.Pair; @@ -38,35 +37,35 @@ public static void initializeNotificationListeners(final Context context) { } pusheNotification.setNotificationListener(new PusheNotificationListener() { @Override - public void onNotification(@NonNull NotificationData notificationData) { + public void onNotification(NotificationData notificationData) { sendBroadcastOnMainThread(c, c.getPackageName() + ".NOTIFICATION_RECEIVED", Pair.create("data", notificationDataJson(notificationData).toString())); } @Override - public void onCustomContentNotification(@NonNull Map customContent) { + public void onCustomContentNotification(Map customContent) { sendBroadcastOnMainThread(c, c.getPackageName() + ".NOTIFICATION_CUSTOM_CONTENT_RECEIVED", Pair.create("json", new JSONObject(customContent).toString())); } @Override - public void onNotificationClick(@NonNull NotificationData notificationData) { + public void onNotificationClick(NotificationData notificationData) { sendBroadcastOnMainThread(c, c.getPackageName() + ".NOTIFICATION_CLICKED", Pair.create("data", notificationDataJson(notificationData).toString())); } @Override - public void onNotificationDismiss(@NonNull NotificationData notificationData) { + public void onNotificationDismiss(NotificationData notificationData) { sendBroadcastOnMainThread(c, c.getPackageName() + ".NOTIFICATION_DISMISSED", Pair.create("data", notificationDataJson(notificationData).toString())); } @Override - public void onNotificationButtonClick(@NonNull NotificationButtonData notificationButtonData, @NonNull NotificationData notificationData) { + public void onNotificationButtonClick(NotificationButtonData notificationButtonData, NotificationData notificationData) { sendBroadcastOnMainThread(c, c.getPackageName() + ".NOTIFICATION_BUTTON_CLICKED", Pair.create("data", notificationDataJson(notificationData).toString()), diff --git a/android/src/main/java/co/pushe/plus/flutter/PushePlugin.java b/android/src/main/java/co/pushe/plus/flutter/PushePlugin.java index df483e0..f76b74e 100644 --- a/android/src/main/java/co/pushe/plus/flutter/PushePlugin.java +++ b/android/src/main/java/co/pushe/plus/flutter/PushePlugin.java @@ -24,6 +24,7 @@ * PushePlugin * * #author Mahdi Malvandi + * FIXME: Warnings will be repaired with the next release */ public class PushePlugin implements MethodCallHandler { diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3d21026..a87beb0 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -39,7 +39,6 @@ android { multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -56,7 +55,6 @@ flutter { } dependencies { + implementation 'androidx.multidex:multidex:2.0.1' testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } diff --git a/example/android/app/src/main/java/co/pushe/pushesampleflutter/MainActivity.java b/example/android/app/src/main/java/co/pushe/pushesampleflutter/MainActivity.java index 6833ff2..f187e5a 100644 --- a/example/android/app/src/main/java/co/pushe/pushesampleflutter/MainActivity.java +++ b/example/android/app/src/main/java/co/pushe/pushesampleflutter/MainActivity.java @@ -6,6 +6,7 @@ import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/example/lib/pushe_sample.dart b/example/lib/pushe_sample.dart index eb7a9d8..178543a 100644 --- a/example/lib/pushe_sample.dart +++ b/example/lib/pushe_sample.dart @@ -206,7 +206,7 @@ class _PusheSampleState extends State { bottom: PreferredSize( child: Padding( padding: EdgeInsets.fromLTRB(0, 0, 0, 2), - child: Text('Flutter plugin: 2.0.0 | native version: 2.0.4', + child: Text('Flutter plugin: 2.0.2 | native version: 2.0.4', style: TextStyle(color: Colors.white)), ), preferredSize: null), diff --git a/example/pubspec.lock b/example/pubspec.lock index 38a83d7..7e4d99c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,34 +1,20 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.2.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.0.4" charcode: dependency: transitive description: @@ -43,20 +29,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" cupertino_icons: dependency: "direct main" description: @@ -74,62 +46,48 @@ packages: description: flutter source: sdk version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.1.6" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.6.2" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" + version: "1.7.0" pushe_flutter: dependency: "direct dev" description: path: ".." relative: true source: path - version: "2.0.0" + version: "2.0.2" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.3" sky_engine: dependency: transitive description: flutter @@ -162,7 +120,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.0.4" term_glyph: dependency: transitive description: @@ -176,7 +134,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.5" typed_data: dependency: transitive description: @@ -191,12 +149,5 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.2.2 <3.0.0" diff --git a/pubspec.lock b/pubspec.lock index 67a7df1..7642229 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,34 +1,20 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.2.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.0.4" charcode: dependency: transitive description: @@ -43,20 +29,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" flutter: dependency: "direct main" description: flutter @@ -67,55 +39,41 @@ packages: description: flutter source: sdk version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.1.6" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.6.2" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" + version: "1.7.0" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.3" sky_engine: dependency: transitive description: flutter @@ -148,7 +106,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.0.4" term_glyph: dependency: transitive description: @@ -162,7 +120,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.5" typed_data: dependency: transitive description: @@ -177,12 +135,5 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.2.2 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index fd2659a..069f07d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pushe_flutter description: Pushe push notification SDK implementation for Flutter framework, for Android and iOS -version: 2.0.1 +version: 2.0.2 authors: - Pushe homepage: https://pushe.co