You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/firebase_messaging/README.md
+35-5Lines changed: 35 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,8 @@ By default background messaging is not enabled. To handle messages in the backgr
73
73
74
74
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).
75
75
76
-
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>/`.
76
+
#### Java's support:
77
+
2. 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>/`.
@@ -98,19 +99,48 @@ By default background messaging is not enabled. To handle messages in the backgr
98
99
}
99
100
```
100
101
101
-
1. In `Application.java`, make sure to change `package io.flutter.plugins.firebasemessagingexample;` to your package's identifier. Your package's identifier should be something like `com.domain.myapplication`.
102
+
3. In `Application.java`, make sure to change `package io.flutter.plugins.firebasemessagingexample;` to your package's identifier. Your package's identifier should be something like `com.domain.myapplication`.
102
103
103
104
```java
104
105
packagecom.domain.myapplication;
105
106
```
107
+
#### Kotlin's support:
108
+
2. Add an `Application.kt` class to your app in the same directory as your `MainActivity.kt`. This is typically found in `<app-name>/android/app/src/main/kotlin/<app-organization-path>/`.
3. In `Application.kt`, make sure to change `package io.flutter.plugins.firebasemessagingexample` to your package's identifier. Your package's identifier should be something like `com.domain.myapplication`.
131
+
132
+
```kotlin
133
+
packagecom.domain.myapplication;
134
+
```
135
+
---
106
136
107
-
1. Set name property of application in `AndroidManifest.xml`. This is typically found in `<app-name>/android/app/src/main/`.
137
+
4. Set name property of application in `AndroidManifest.xml`. This is typically found in `<app-name>/android/app/src/main/`.
108
138
109
139
```xml
110
140
<applicationandroid:name=".Application" ...>
111
141
```
112
142
113
-
1. Define a **TOP-LEVEL** or **STATIC** function to handle background messages
143
+
5. Define a **TOP-LEVEL** or **STATIC** function to handle background messages
0 commit comments