Skip to content

Commit

Permalink
[Firebase_messaging] Fix Deprecated API usage (firebase#136)
Browse files Browse the repository at this point in the history
* Upgrade firebase-messaging to 20.0.0
* Suppress unchecked warnings
  • Loading branch information
ashutoshkmr authored and collinjackson committed Sep 19, 2019
1 parent 28411c1 commit 5c33e5a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.1.6

* Fix warnings when compiling on Android.

## 5.1.5

* Enable background message handling on Android.
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_messaging/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-messaging:18.0.0'
api 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-common:16.1.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public void onMethodCall(final MethodCall call, final Result result) {
long setupCallbackHandle = 0;
long backgroundMessageHandle = 0;
try {
@SuppressWarnings("unchecked")
Map<String, Long> callbacks = ((Map<String, Long>) call.arguments);
setupCallbackHandle = callbacks.get("setupHandle");
backgroundMessageHandle = callbacks.get("backgroundHandle");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void onNewToken(String token) {
*/
public static void startBackgroundIsolate(Context context, long callbackHandle) {
FlutterMain.ensureInitializationComplete(context, null);
String appBundlePath = FlutterMain.findAppBundlePath(context);
String appBundlePath = FlutterMain.findAppBundlePath();
FlutterCallbackInformation flutterCallback =
FlutterCallbackInformation.lookupCallbackInformation(callbackHandle);
if (flutterCallback == null) {
Expand Down Expand Up @@ -309,7 +309,7 @@ private static boolean isApplicationForeground(Context context) {
KeyguardManager keyguardManager =
(KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);

if (keyguardManager.inKeyguardRestrictedInputMode()) {
if (keyguardManager.isKeyguardLocked()) {
return false;
}
int myPid = Process.myPid();
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging
version: 5.1.5
version: 5.1.6

flutter:
plugin:
Expand Down

0 comments on commit 5c33e5a

Please sign in to comment.