Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(messaging, android): removed unsafe & deprecated API. E.g. `…
…LocalBroadcastManager` replaced by `LiveData` (#11659)
- Loading branch information
1 parent
639bc2e
commit 690160f
Showing
11 changed files
with
115 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...main/java/io/flutter/plugins/firebase/messaging/FlutterFirebaseRemoteMessageLiveData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2023 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.firebase.messaging; | ||
|
||
import androidx.lifecycle.LiveData; | ||
import com.google.firebase.messaging.RemoteMessage; | ||
|
||
public class FlutterFirebaseRemoteMessageLiveData extends LiveData<RemoteMessage> { | ||
private static FlutterFirebaseRemoteMessageLiveData instance; | ||
|
||
public static FlutterFirebaseRemoteMessageLiveData getInstance() { | ||
if (instance == null) { | ||
instance = new FlutterFirebaseRemoteMessageLiveData(); | ||
} | ||
return instance; | ||
} | ||
|
||
public void postRemoteMessage(RemoteMessage remoteMessage) { | ||
postValue(remoteMessage); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...oid/src/main/java/io/flutter/plugins/firebase/messaging/FlutterFirebaseTokenLiveData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2023 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.firebase.messaging; | ||
|
||
import androidx.lifecycle.LiveData; | ||
|
||
public class FlutterFirebaseTokenLiveData extends LiveData<String> { | ||
private static FlutterFirebaseTokenLiveData instance; | ||
|
||
public static FlutterFirebaseTokenLiveData getInstance() { | ||
if (instance == null) { | ||
instance = new FlutterFirebaseTokenLiveData(); | ||
} | ||
return instance; | ||
} | ||
|
||
public void postToken(String token) { | ||
postValue(token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
packages/firebase_messaging/firebase_messaging/example/android/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/firebase_messaging/firebase_messaging/example/android/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
android.defaults.buildfeatures.buildconfig=true | ||
android.nonTransitiveRClass=false | ||
android.nonFinalResIds=false | ||
android.nonFinalResIds=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters