Skip to content
Merged
Show file tree
Hide file tree
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: 2 additions & 2 deletions messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ However, there can only be one service in each app that receives FCM
messages. If multiple are declared in the Manifest then the first
one will be chosen.

In order to make the Kotlin messaging sample functional, you must
remove the following from the `.java.MyFirebaseMessagingService` entry
In order to make the Java messaging sample functional, you must
remove the following from the `.kotlin.MyFirebaseMessagingService` entry
in the `AndroidManifest.xml`:

```
Expand Down
8 changes: 6 additions & 2 deletions messaging/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@
<activity android:name=".kotlin.MainActivity" />
<activity android:name=".java.MainActivity" />

<service android:name=".kotlin.MyFirebaseMessagingService">
<service
android:name=".kotlin.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<!-- [START firebase_service] -->
<service android:name=".java.MyFirebaseMessagingService">
<service
android:name=".java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;

/**
* NOTE: There can only be one service in each app that receives FCM messages. If multiple
* are declared in the Manifest then the first one will be chosen.
*
* In order to make this Java sample functional, you must remove the following from the Kotlin messaging
* service in the AndroidManifest.xml:
*
* <intent-filter>
* <action android:name="com.google.firebase.MESSAGING_EVENT" />
* </intent-filter>
*/
public class MyFirebaseMessagingService extends FirebaseMessagingService {

private static final String TAG = "MyFirebaseMsgService";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.google.firebase.quickstart.fcm.R

/**
* NOTE: There can only be one service in each app that receives FCM messages. If multiple
* are declared in the Manifest then the first one will be chosen.
*
* In order to make this Kotlin sample functional, you must remove the following from the Java messaging
* service in the AndroidManifest.xml:
*
* <intent-filter>
* <action android:name="com.google.firebase.MESSAGING_EVENT" />
* </intent-filter>
*/
class MyFirebaseMessagingService : FirebaseMessagingService() {

/**
Expand Down