Skip to content

Commit

Permalink
Feat: Fix problem with androidX and release 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdi-malv committed Jan 30, 2020
1 parent 6751051 commit 5241b34
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 134 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.2

- Fix issue with AndroidX

## 2.0.1

- Fix formatting of plugin
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>
Run: `git clone https://github.com/pusheco/pushe-flutter.git`<br>
The go to example: `cd example`<br>
And run the example on a connected device: `flutter run`<br>

Expand Down Expand Up @@ -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/)
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ android {

defaultConfig {
minSdkVersion 16
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<String, Object> customContent) {
public void onCustomContentNotification(Map<String, Object> 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()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* PushePlugin
*
* #author Mahdi Malvandi
* FIXME: Warnings will be repaired with the next release
*/
public class PushePlugin implements MethodCallHandler {

Expand Down
4 changes: 1 addition & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ android {
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pushe_sample.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class _PusheSampleState extends State<PusheSampleWidget> {
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),
Expand Down
71 changes: 11 additions & 60 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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"
Loading

0 comments on commit 5241b34

Please sign in to comment.