Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 5fa9cb3

Browse files
committed
[firebase_dynamic_links] Renaming configure to onLink
1 parent 23e4993 commit 5fa9cb3

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

packages/firebase_dynamic_links/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
the dynamic link which opened the app and links clicked during app execution (active and background).
55
`retrieveDynamicLink` has been replaced with two different functions:
66
- `getLaunchLink` a future to retrieve the link that opened the app
7-
- `configure` a callback to listen to links opened while the app is active or in background
7+
- `onLink` a callback to listen to links opened while the app is active or in background
88

99
## 0.4.0+5
1010

packages/firebase_dynamic_links/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ applinks:YOUR_SUBDOMAIN.page.link
9898
```
9999

100100
4. To receive a dynamic link, call the `getLaunchLink()` method from `FirebaseDynamicLinks` which gets the link that opened the app (or null if it was not opened via a dynamic link)
101-
and configure listeners for link callbacks when the application is active or in background calling `configure`.
101+
and configure listeners for link callbacks when the application is active or in background calling `onLink`.
102102

103103
```dart
104104
void main() {
@@ -129,15 +129,15 @@ class MyHomeWidgetState extends State<MyHomeWidget> {
129129
Navigator.pushNamed(context, deepLink.path);
130130
}
131131
132-
FirebaseDynamicLinks.instance.configure(
133-
onLinkSuccess: (PendingDynamicLinkData dynamicLink) async {
132+
FirebaseDynamicLinks.instance.onLink(
133+
onSuccess: (PendingDynamicLinkData dynamicLink) async {
134134
final Uri deepLink = dynamicLink?.link;
135135
136136
if (deepLink != null) {
137137
Navigator.pushNamed(context, deepLink.path);
138138
}
139139
},
140-
onLinkError: (OnLinkErrorException e) async {
140+
onError: (OnLinkErrorException e) async {
141141
print('onLinkError');
142142
print(e.message);
143143
}

packages/firebase_dynamic_links/example/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ class _MainScreenState extends State<_MainScreen> {
4848
Navigator.pushNamed(context, deepLink.path);
4949
}
5050

51-
FirebaseDynamicLinks.instance.configure(
52-
onLinkSuccess: (PendingDynamicLinkData dynamicLink) async {
51+
FirebaseDynamicLinks.instance.onLink(
52+
onSuccess: (PendingDynamicLinkData dynamicLink) async {
5353
final Uri deepLink = dynamicLink?.link;
5454

5555
if (deepLink != null) {
5656
Navigator.pushNamed(context, deepLink.path);
5757
}
58-
}, onLinkError: (OnLinkErrorException e) async {
58+
}, onError: (OnLinkErrorException e) async {
5959
print('onLinkError');
6060
print(e.message);
6161
});

packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class FirebaseDynamicLinks {
6363
}
6464

6565
/// Configures onLink listeners: it has two methods for success and failure.
66-
void configure({
67-
OnLinkSuccessCallback onLinkSuccess,
68-
OnLinkErrorCallback onLinkError,
66+
void onLink({
67+
OnLinkSuccessCallback onSuccess,
68+
OnLinkErrorCallback onError,
6969
}) {
70-
_onLinkSuccess = onLinkSuccess;
71-
_onLinkError = onLinkError;
70+
_onLinkSuccess = onSuccess;
71+
_onLinkError = onError;
7272
channel.setMethodCallHandler(_handleMethod);
7373
}
7474

0 commit comments

Comments
 (0)