@@ -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.
@@ -36,7 +37,7 @@ class NotificationOpenService {
36
37
37
38
assert (debugLog ('got notif: url: $url ' ));
38
39
assert (url.scheme == 'zulip' && url.host == 'notification' );
39
- final payload = NotificationOpenPayload .parseUrl (url);
40
+ final payload = NotificationOpenPayload .parseAndroidNotificationUrl (url);
40
41
41
42
final account = globalStore.accounts.firstWhereOrNull (
42
43
(account) => account.realmUrl.origin == payload.realmUrl.origin
@@ -57,8 +58,8 @@ class NotificationOpenService {
57
58
58
59
/// Navigates to the [MessageListPage] of the specific conversation
59
60
/// given the `zulip://notification/…` Android intent data URL,
60
- /// generated with [NotificationOpenPayload.buildUrl] while creating
61
- /// the notification.
61
+ /// generated with [NotificationOpenPayload.buildAndroidNotificationUrl]
62
+ /// while creating the notification.
62
63
static Future <void > navigateForNotification (Uri url) async {
63
64
assert (defaultTargetPlatform == TargetPlatform .android);
64
65
assert (debugLog ('opened notif: url: $url ' ));
@@ -76,8 +77,8 @@ class NotificationOpenService {
76
77
}
77
78
}
78
79
79
- /// The information contained in 'zulip:// notification/…' internal
80
- /// Android intent data URL, used for notification-open flow .
80
+ /// The data from a notification that describes what to do
81
+ /// when the user opens the notification.
81
82
class NotificationOpenPayload {
82
83
final Uri realmUrl;
83
84
final int userId;
@@ -89,7 +90,10 @@ class NotificationOpenPayload {
89
90
required this .narrow,
90
91
});
91
92
92
- factory NotificationOpenPayload .parseUrl (Uri url) {
93
+ /// Parses the internal Android notification url, that was created using
94
+ /// [buildAndroidNotificationUrl] , and retrieves the information required
95
+ /// for navigation.
96
+ factory NotificationOpenPayload .parseAndroidNotificationUrl (Uri url) {
93
97
if (url case Uri (
94
98
scheme: 'zulip' ,
95
99
host: 'notification' ,
@@ -135,7 +139,7 @@ class NotificationOpenPayload {
135
139
}
136
140
}
137
141
138
- Uri buildUrl () {
142
+ Uri buildAndroidNotificationUrl () {
139
143
return Uri (
140
144
scheme: 'zulip' ,
141
145
host: 'notification' ,
0 commit comments