Skip to content

[firebase_messaging] Declares Android Firebase Messaging dependency as api #1983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
## 6.0.15

* Declares Android Firebase Messaging dependency as `api` to allow it to be accessed from the app, and updates documentation.

## 6.0.14

* Fix for missing UserAgent.h compilation failures.
12 changes: 0 additions & 12 deletions packages/firebase_messaging/README.md
Original file line number Diff line number Diff line change
@@ -61,18 +61,6 @@ for more.

By default background messaging is not enabled. To handle messages in the background:

1. Add the `com.google.firebase:firebase-messaging` dependency in your app-level `build.gradle` file that is typically located at `<app-name>/android/app/build.gradle`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to apps that have already followed this step when they receive this change? Will gradle complain in an actionable way, or is this going to break consumers of the plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No there won't be any conflicts, the user would effectively just be redeclaring a dependency already available to them. Gradles dependency resolution will handle everything.


```gradle
dependencies {
// ...

implementation 'com.google.firebase:firebase-messaging:<latest_version>'
}
```

Note: you can find out what the latest version of the plugin is [here ("Cloud Messaging")](https://firebase.google.com/support/release-notes/android#latest_sdk_versions).

1. Add an `Application.java` class to your app in the same directory as your `MainActivity.java`. This is typically found in `<app-name>/android/app/src/main/java/<app-organization-path>/`.

```java
2 changes: 1 addition & 1 deletion packages/firebase_messaging/android/build.gradle
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ android {
disable 'InvalidPackage'
}
dependencies {
implementation 'com.google.firebase:firebase-messaging:20.0.1'
api 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
}
2 changes: 1 addition & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name: firebase_messaging
description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging
version: 6.0.14
version: 6.0.15

flutter:
plugin: