Skip to content

Commit 5c33e5a

Browse files
ashutoshkmrcollinjackson
authored andcommitted
[Firebase_messaging] Fix Deprecated API usage (#136)
* Upgrade firebase-messaging to 20.0.0 * Suppress unchecked warnings
1 parent 28411c1 commit 5c33e5a

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

packages/firebase_messaging/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.1.6
2+
3+
* Fix warnings when compiling on Android.
4+
15
## 5.1.5
26

37
* Enable background message handling on Android.

packages/firebase_messaging/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ android {
4545
disable 'InvalidPackage'
4646
}
4747
dependencies {
48-
api 'com.google.firebase:firebase-messaging:18.0.0'
48+
api 'com.google.firebase:firebase-messaging:20.0.0'
4949
implementation 'com.google.firebase:firebase-common:16.1.0'
5050
implementation 'androidx.annotation:annotation:1.0.0'
5151
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public void onMethodCall(final MethodCall call, final Result result) {
121121
long setupCallbackHandle = 0;
122122
long backgroundMessageHandle = 0;
123123
try {
124+
@SuppressWarnings("unchecked")
124125
Map<String, Long> callbacks = ((Map<String, Long>) call.arguments);
125126
setupCallbackHandle = callbacks.get("setupHandle");
126127
backgroundMessageHandle = callbacks.get("backgroundHandle");

packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void onNewToken(String token) {
140140
*/
141141
public static void startBackgroundIsolate(Context context, long callbackHandle) {
142142
FlutterMain.ensureInitializationComplete(context, null);
143-
String appBundlePath = FlutterMain.findAppBundlePath(context);
143+
String appBundlePath = FlutterMain.findAppBundlePath();
144144
FlutterCallbackInformation flutterCallback =
145145
FlutterCallbackInformation.lookupCallbackInformation(callbackHandle);
146146
if (flutterCallback == null) {
@@ -309,7 +309,7 @@ private static boolean isApplicationForeground(Context context) {
309309
KeyguardManager keyguardManager =
310310
(KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
311311

312-
if (keyguardManager.inKeyguardRestrictedInputMode()) {
312+
if (keyguardManager.isKeyguardLocked()) {
313313
return false;
314314
}
315315
int myPid = Process.myPid();

packages/firebase_messaging/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
33
messaging solution that lets you reliably deliver messages on Android and iOS.
44
author: Flutter Team <[email protected]>
55
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging
6-
version: 5.1.5
6+
version: 5.1.6
77

88
flutter:
99
plugin:

0 commit comments

Comments
 (0)