Repository navigation
docs(messaging): document the opt-in that register() needs #18970
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -161,6 +161,9 @@ class FirebaseMessaging extends FirebasePlugin { | |||||||||
| /// Removes access to an FCM token previously authorized. | ||||||||||
| /// | ||||||||||
| /// Messages sent by the server to this token will fail. | ||||||||||
| /// | ||||||||||
| /// On Android, iOS and macOS, this fails once registration by FID is enabled | ||||||||||
| /// for [register]. | ||||||||||
|
Comment on lines
+165
to
+166
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrasing "enabled for [register]" is slightly awkward because the setting is enabled globally for the application/SDK, not specifically "for" the
Suggested change
|
||||||||||
| @Deprecated('Use unregister() and onUnregistered instead.') | ||||||||||
| Future<void> deleteToken() { | ||||||||||
| return _delegate.deleteToken(); | ||||||||||
|
|
@@ -181,6 +184,18 @@ class FirebaseMessaging extends FirebasePlugin { | |||||||||
| /// Once registration completes, [onRegistered] provides the Firebase | ||||||||||
| /// Installation ID (FID) that can be used as the direct-send target for this | ||||||||||
| /// app instance. | ||||||||||
| /// | ||||||||||
| /// On Android, iOS and macOS, registration by FID is turned off by default, | ||||||||||
| /// and this method fails until the app enables it: | ||||||||||
|
Comment on lines
+188
to
+189
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "disabled by default" is more standard and idiomatic in API documentation than "turned off by default".
Suggested change
|
||||||||||
| /// | ||||||||||
| /// * Android: add | ||||||||||
| /// `<meta-data android:name="firebase_messaging_installation_id_enabled" android:value="true" />` | ||||||||||
| /// inside `<application>` in `AndroidManifest.xml`. | ||||||||||
| /// * iOS and macOS: set `FirebaseMessagingInstallationIdEnabled` to `true` | ||||||||||
| /// in `Info.plist`. | ||||||||||
| /// | ||||||||||
| /// Enabling it turns off the token API on those platforms: [getToken] and | ||||||||||
| /// [deleteToken] then fail. | ||||||||||
| Future<void> register({String? vapidKey, String? serviceWorkerScriptPath}) { | ||||||||||
| return _delegate.register( | ||||||||||
| vapidKey: vapidKey, | ||||||||||
|
|
@@ -192,6 +207,9 @@ class FirebaseMessaging extends FirebasePlugin { | |||||||||
| /// | ||||||||||
| /// Once unregistration completes, [onUnregistered] provides the Firebase | ||||||||||
| /// Installation ID (FID) that is no longer active for direct-send messaging. | ||||||||||
| /// | ||||||||||
| /// Like [register], this fails on Android, iOS and macOS unless registration | ||||||||||
| /// by FID is enabled in the app; see [register] for the setting. | ||||||||||
| Future<void> unregister() { | ||||||||||
| return _delegate.unregister(); | ||||||||||
| } | ||||||||||
|
|
@@ -219,6 +237,9 @@ class FirebaseMessaging extends FirebasePlugin { | |||||||||
| /// On web, a custom messaging service worker can be registered with | ||||||||||
| /// [serviceWorkerScriptPath]. This must point to a JavaScript file in the | ||||||||||
| /// root of the app's `web` directory. | ||||||||||
| /// | ||||||||||
| /// On Android, iOS and macOS, this fails once registration by FID is enabled | ||||||||||
| /// for [register]. | ||||||||||
|
Comment on lines
+241
to
+242
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrasing "enabled for [register]" is slightly awkward because the setting is enabled globally for the application/SDK, not specifically "for" the
Suggested change
|
||||||||||
| @Deprecated('Use register() and onRegistered instead.') | ||||||||||
| Future<String?> getToken({ | ||||||||||
| String? vapidKey, | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using "disable ... by default" is more standard and idiomatic in technical documentation than "turn ... off by default".