File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ import UserNotifications
28
28
)
29
29
}
30
30
31
+ // Allow only `zulip://login` external urls.
32
+ override func application( _ application: UIApplication , open url: URL , options: [ UIApplication . OpenURLOptionsKey : Any ] = [ : ] ) -> Bool {
33
+ if url. scheme == " zulip " && url. host == " login " {
34
+ return super. application ( application, open: url, options: options)
35
+ }
36
+ return false
37
+ }
38
+
31
39
// Handle notification tap while the app is running.
32
40
override func userNotificationCenter(
33
41
_ center: UNUserNotificationCenter ,
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ class ZulipApp extends StatefulWidget {
141
141
class _ZulipAppState extends State <ZulipApp > with WidgetsBindingObserver {
142
142
@override
143
143
Future <bool > didPushRouteInformation (routeInformation) async {
144
+ print ("didPushRouteInformation: ${routeInformation .uri }" );
144
145
switch (routeInformation.uri) {
145
146
case Uri (scheme: 'zulip' , host: 'login' ) && var url:
146
147
await LoginPage .handleWebAuthUrl (url);
@@ -206,7 +207,8 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {
206
207
// like [Navigator.push], never mere names as with [Navigator.pushNamed].
207
208
onGenerateRoute: (_) => null ,
208
209
209
- onGenerateInitialRoutes: (_) {
210
+ onGenerateInitialRoutes: (String initialRoute) {
211
+ print ("onGenerateInitialRoutes: $initialRoute " );
210
212
return [
211
213
if (initialAccountId == null )
212
214
MaterialWidgetRoute (page: const ChooseAccountPage ())
You can’t perform that action at this time.
0 commit comments