Skip to content

Commit a2f9b90

Browse files
authored
UPDATE flutter-hms-push 6.12.0-302
1 parent 9fb7094 commit a2f9b90

39 files changed

Lines changed: 126 additions & 109 deletions

flutter-hms-push/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 6.12.0+302
2+
3+
- Fixed stability and performance issues.
4+
> You are advised to use this version. To use it, you only need to update the version number and do not need to modify any code for adaptation.
5+
6+
## 6.12.0+301
7+
8+
- Minor optimization.
9+
110
## 6.12.0+300
211

312
- To solve stability and performance problems, it is recommended that you use it integratedly. You only need to upgrade the version number, and no other code adaptation is required.

flutter-hms-push/OpenSourceSoftwareNotice.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="color:#000000"><strong><span style="font-size:16pt"><span style="font-family:Arial,sans-serif">Copyright Notice and License Texts</span></span></strong></span></span></span></p>
1616

17-
<h1 style="text-align:start"><span style="font-size:22pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><strong><span style="color:#000000"><span style="font-size:10.5pt"><span style="font-family:Arial,sans-serif">Software: Fresco 2.6.0</span></span></span></strong></span></span></h1>
17+
<h1 style="text-align:start"><span style="font-size:22pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><strong><span style="color:#000000"><span style="font-size:10.5pt"><span style="font-family:Arial,sans-serif">Software: Fresco 3.1.3</span></span></span></strong></span></span></h1>
1818

1919
<p style="text-align:start"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="color:#000000"><strong><span style="font-family:Arial,sans-serif">Copyright notice:</span></strong></span></span></span></p>
2020

flutter-hms-push/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ android {
4444

4545
dependencies {
4646
implementation "com.huawei.hms:push:6.12.0.300"
47-
implementation "com.facebook.fresco:fresco:2.6.0"
47+
implementation "com.facebook.fresco:fresco:3.1.3"
4848
}

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/PushPlugin.java

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,25 @@
6969

7070
public class PushPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware {
7171
private static final String TAG = "HmsFlutterPush";
72+
7273
private MethodChannel channel;
74+
7375
private Context context;
76+
7477
private HmsLocalNotification hmsLocalNotification;
78+
7579
private NotificationIntentListener notificationIntentListener;
80+
7681
private FlutterHmsInstanceId hmsInstanceId;
82+
7783
private FlutterHmsMessaging hmsMessaging;
84+
7885
private FlutterHmsProfile hmsProfile;
86+
7987
private FlutterHmsConsent hmsConsent;
88+
8089
private Activity activity;
90+
8191
private final List<EventChannel> eventChannels = new ArrayList<>();
8292

8393
@Override
@@ -98,31 +108,31 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin
98108
private void setStreamHandlers(BinaryMessenger messenger) {
99109
Map<String, EventChannel.StreamHandler> streams = new ConcurrentHashMap<>();
100110
streams.put(Channel.TOKEN_CHANNEL.id(),
101-
new DefaultStreamHandler(context, TokenReceiver::new, PushIntent.TOKEN_INTENT_ACTION));
111+
new DefaultStreamHandler(context, TokenReceiver::new, PushIntent.TOKEN_INTENT_ACTION));
102112

103113
streams.put(Channel.MULTI_SENDER_TOKEN_CHANNEL.id(),
104-
new DefaultStreamHandler(context, MultiSenderTokenReceiver::new,
105-
PushIntent.MULTI_SENDER_TOKEN_INTENT_ACTION));
114+
new DefaultStreamHandler(context, MultiSenderTokenReceiver::new,
115+
PushIntent.MULTI_SENDER_TOKEN_INTENT_ACTION));
106116

107117
streams.put(Channel.REMOTE_MESSAGE_RECEIVE_CHANNEL.id(),
108-
new DefaultStreamHandler(context, RemoteDataMessageReceiver::new,
109-
PushIntent.REMOTE_DATA_MESSAGE_INTENT_ACTION));
118+
new DefaultStreamHandler(context, RemoteDataMessageReceiver::new,
119+
PushIntent.REMOTE_DATA_MESSAGE_INTENT_ACTION));
110120

111121
streams.put(Channel.REMOTE_MESSAGE_SEND_STATUS_CHANNEL.id(),
112-
new DefaultStreamHandler(context, RemoteMessageSentDeliveredReceiver::new,
113-
PushIntent.REMOTE_MESSAGE_SENT_DELIVERED_ACTION));
122+
new DefaultStreamHandler(context, RemoteMessageSentDeliveredReceiver::new,
123+
PushIntent.REMOTE_MESSAGE_SENT_DELIVERED_ACTION));
114124

115125
// For sending remote message notification's custom intent Uri events
116126
streams.put(Channel.REMOTE_MESSAGE_NOTIFICATION_INTENT_CHANNEL.id(),
117-
new DefaultStreamHandler(context, RemoteMessageNotificationIntentReceiver::new,
118-
PushIntent.REMOTE_MESSAGE_NOTIFICATION_INTENT_ACTION));
127+
new DefaultStreamHandler(context, RemoteMessageNotificationIntentReceiver::new,
128+
PushIntent.REMOTE_MESSAGE_NOTIFICATION_INTENT_ACTION));
119129

120130
streams.put(Channel.NOTIFICATION_OPEN_CHANNEL.id(),
121-
new DefaultStreamHandler(context, NotificationOpenEventReceiver::new, PushIntent.NOTIFICATION_OPEN_ACTION));
131+
new DefaultStreamHandler(context, NotificationOpenEventReceiver::new, PushIntent.NOTIFICATION_OPEN_ACTION));
122132

123133
streams.put(Channel.LOCAL_NOTIFICATION_CLICK_CHANNEL.id(),
124-
new DefaultStreamHandler(context, LocalNotificationClickEventReceiver::new,
125-
PushIntent.LOCAL_NOTIFICATION_CLICK_ACTION));
134+
new DefaultStreamHandler(context, LocalNotificationClickEventReceiver::new,
135+
PushIntent.LOCAL_NOTIFICATION_CLICK_ACTION));
126136

127137
for (Map.Entry<String, EventChannel.StreamHandler> entry : streams.entrySet()) {
128138
EventChannel eventChannel = new EventChannel(messenger, entry.getKey());
@@ -177,7 +187,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
177187
break;
178188
case consentOff:
179189
hmsConsent.consentOff(result);
180-
break;
190+
break;
181191
default:
182192
onMethodCallToken(call, result);
183193
}

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/config/NotificationAttributes.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ private NotificationAttributes(JSONObject json) {
221221
NotificationConstants.ALLOW_WHILE_IDLE);
222222
dontNotifyInForeground = json.has(NotificationConstants.DONT_NOTIFY_IN_FOREGROUND) && json.getBoolean(
223223
NotificationConstants.DONT_NOTIFY_IN_FOREGROUND);
224-
data = json.has(NotificationConstants.DATA)
225-
? json.get(NotificationConstants.DATA).toString()
226-
: null;
224+
data = json.has(NotificationConstants.DATA) ? json.get(NotificationConstants.DATA).toString() : null;
227225
} catch (IllegalStateException | JSONException | NumberFormatException | NullPointerException e) {
228226
throw new IllegalStateException(Code.RESULT_ERROR.code(), e);
229227
}

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/constants/Code.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ public enum Code {
163163
// Invalid parameter.
164164
ERROR_PARAMETER_INVALID("1210");
165165

166-
167166
private String code;
168167

169168
Code(String code) {

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/hms/FlutterHmsConsent.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828

2929
public class FlutterHmsConsent {
3030
private static final String TAG = FlutterHmsConsent.class.getSimpleName();
31+
3132
private final HMSLogger hmsLogger;
33+
3234
private final Context context;
3335

3436
public FlutterHmsConsent(@NonNull Context context) {
@@ -45,7 +47,8 @@ public void consentOn(final Result result) {
4547
result.success(Code.RESULT_SUCCESS.code());
4648
} else {
4749
hmsLogger.sendSingleEvent("consentOn", Code.RESULT_UNKNOWN.code());
48-
result.error(Code.RESULT_UNKNOWN.code(), task.getException().getMessage(), task.getException().getCause());
50+
result.error(Code.RESULT_UNKNOWN.code(), task.getException().getMessage(),
51+
task.getException().getCause());
4952
}
5053
});
5154
} catch (Exception e) {
@@ -63,7 +66,8 @@ public void consentOff(final Result result) {
6366
result.success(Code.RESULT_SUCCESS.code());
6467
} else {
6568
hmsLogger.sendSingleEvent("consentOff", Code.RESULT_UNKNOWN.code());
66-
result.error(Code.RESULT_UNKNOWN.code(), task.getException().getMessage(), task.getException().getCause());
69+
result.error(Code.RESULT_UNKNOWN.code(), task.getException().getMessage(),
70+
task.getException().getCause());
6771
}
6872
});
6973
} catch (Exception e) {

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/hms/FlutterHmsInstanceId.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
*/
4848
public class FlutterHmsInstanceId {
4949
private static final String TAG = FlutterHmsInstanceId.class.getSimpleName();
50+
5051
private final HMSLogger hmsLogger;
52+
5153
private final Context context;
5254

5355
public FlutterHmsInstanceId(Context context) {
@@ -114,7 +116,8 @@ public void getToken(final String scope) {
114116
hmsLogger.sendSingleEvent("getToken");
115117
resolution.send();
116118
} catch (PendingIntent.CanceledException ex) {
117-
HMSLogger.getInstance(PluginContext.getContext()).sendSingleEvent("onTokenError", ex.getMessage());
119+
HMSLogger.getInstance(PluginContext.getContext())
120+
.sendSingleEvent("onTokenError", ex.getMessage());
118121
}
119122
}
120123
Intent resolutionIntent = e.getResolutionIntent();

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/hms/FlutterHmsMessageService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ public void onTokenError(Exception e, Bundle bundle) {
105105
super.onTokenError(e, bundle);
106106
if (PluginContext.getContext() != null) {
107107
if (e instanceof ResolvableApiException) {
108-
HMSLogger.getInstance(PluginContext.getContext()).sendSingleEvent("onTokenError", String.valueOf(((ResolvableApiException) e).getStatusCode()));
108+
HMSLogger.getInstance(PluginContext.getContext())
109+
.sendSingleEvent("onTokenError", String.valueOf(((ResolvableApiException) e).getStatusCode()));
109110
PendingIntent resolution = ((ResolvableApiException) e).getResolution();
110111
if (resolution != null) {
111112
try {
112113
HMSLogger.getInstance(PluginContext.getContext()).sendSingleEvent("onTokenError");
113114
resolution.send();
114115
} catch (PendingIntent.CanceledException ex1) {
115-
HMSLogger.getInstance(PluginContext.getContext()).sendSingleEvent("onTokenError", ex1.getMessage());
116+
HMSLogger.getInstance(PluginContext.getContext())
117+
.sendSingleEvent("onTokenError", ex1.getMessage());
116118
}
117119
}
118120
Intent resolutionIntent = ((ResolvableApiException) e).getResolutionIntent();

flutter-hms-push/android/src/main/java/com/huawei/hms/flutter/push/hms/FlutterHmsMessaging.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*/
3838
public class FlutterHmsMessaging {
3939
private final HMSLogger hmsLogger;
40+
4041
private final Context context;
4142

4243
public FlutterHmsMessaging(@NonNull Context context) {

0 commit comments

Comments
 (0)