@@ -19,8 +19,9 @@ class NotificationOpenService {
19
19
20
20
/// Provides the route and the account ID by parsing the notification URL.
21
21
///
22
- /// The URL must have been generated using [NotificationOpenPayload.buildUrl]
23
- /// while creating the notification.
22
+ /// The URL must have been generated using
23
+ /// [NotificationOpenPayload.buildAndroidNotificationUrl] while creating the
24
+ /// notification.
24
25
///
25
26
/// Returns null and shows an error dialog if the associated account is not
26
27
/// found in the global store.
@@ -34,7 +35,7 @@ class NotificationOpenService {
34
35
35
36
assert (debugLog ('got notif: url: $url ' ));
36
37
assert (url.scheme == 'zulip' && url.host == 'notification' );
37
- final payload = NotificationOpenPayload .parseUrl (url);
38
+ final payload = NotificationOpenPayload .parseAndroidNotificationUrl (url);
38
39
39
40
final account = globalStore.accounts.firstWhereOrNull (
40
41
(account) => account.realmUrl.origin == payload.realmUrl.origin
@@ -55,8 +56,8 @@ class NotificationOpenService {
55
56
56
57
/// Navigates to the [MessageListPage] of the specific conversation
57
58
/// given the `zulip://notification/…` Android intent data URL,
58
- /// generated with [NotificationOpenPayload.buildUrl] while creating
59
- /// the notification.
59
+ /// generated with [NotificationOpenPayload.buildAndroidNotificationUrl]
60
+ /// while creating the notification.
60
61
static Future <void > navigateForNotification (Uri url) async {
61
62
assert (defaultTargetPlatform == TargetPlatform .android);
62
63
assert (debugLog ('opened notif: url: $url ' ));
@@ -74,8 +75,8 @@ class NotificationOpenService {
74
75
}
75
76
}
76
77
77
- /// The information contained in 'zulip:// notification/…' internal
78
- /// Android intent data URL, used for notification-open flow .
78
+ /// The data from a notification that describes what to do
79
+ /// when the user opens the notification.
79
80
class NotificationOpenPayload {
80
81
final Uri realmUrl;
81
82
final int userId;
@@ -87,7 +88,10 @@ class NotificationOpenPayload {
87
88
required this .narrow,
88
89
});
89
90
90
- factory NotificationOpenPayload .parseUrl (Uri url) {
91
+ /// Parses the internal Android notification url, that was created using
92
+ /// [buildAndroidNotificationUrl] , and retrieves the information required
93
+ /// for navigation.
94
+ factory NotificationOpenPayload .parseAndroidNotificationUrl (Uri url) {
91
95
if (url case Uri (
92
96
scheme: 'zulip' ,
93
97
host: 'notification' ,
@@ -133,7 +137,7 @@ class NotificationOpenPayload {
133
137
}
134
138
}
135
139
136
- Uri buildUrl () {
140
+ Uri buildAndroidNotificationUrl () {
137
141
return Uri (
138
142
scheme: 'zulip' ,
139
143
host: 'notification' ,
0 commit comments