Share
Embed
Transcript
23 slides
-
A story about mobile navigation in Deezer for Windows Christopher
Maneu Brown Bag Lunch @ Deezer 16/09/2015 -
Why talking about navigation ? • Complex subject • Few
guidances when your app scale (whenever the platform) -
Our requirements Views should not navigate to views
Unified way to address a view Being able to deeplink to a view Being able to change the view on the fly (gatekeeping, A/B testing, …) Integrate well in to the framework(s) -
public void OnAlbumsButtonClicked() { } Windows Phone navigation 101 NavigationService.NavigateTo(new
Uri("/Pages/AlbumsPage.xaml", UriKind.Relative)); ×Views should not navigate to views ×Unified way to address a view ×Being able to deeplink to a view ×Being able to change the view on the fly (gatekeeping, A/B testing, …) √ Integrate well in to the framework(s) -
Deeplink all the things • The ViewModel / Activity /
Controller is responsible to construct all the navigation URIs • A User control gets this URI and perform navigation on tap • We implement an UriMapper ! dz://mylibrary/albums => /Pages/AlbumsPage.xaml The Windows Phone Frame accepts an UriMapper -
Deeplink all the things √ Views should not navigate to
views √ Unified way to address a view × Being able to deeplink to a view √ Being able to change the view on the fly (gatekeeping, A/B testing, …) √ Integrate well in to the framework(s) -
public void OnAlbumsButtonClicked() { } Windows 8 Navigation 101 NavigationService.NavigateTo(
typeof(AlbumPage) ); ×Views should not navigate to views (WE NAVIGATE TO VIEW CLASS !!) ×Unified way to address a view ×Being able to deeplink to a view ×Being able to change the view on the fly (gatekeeping, A/B testing, …) √ Integrate well in to the framework(s) -
Windows 8 Navigation, Reinvented √ Views should not navigate to
views √ Unified way to address a view × Being able to deeplink to a view √ Being able to change the view on the fly (gatekeeping, A/B testing, …) √ Integrate well in to the framework(s) -
The case of unexplained • A bug into Windows Phone
navigation Framework • Causes random crashes • Several months of investigation • => WP Nav. Fw. Does not support Absolute URIs navigations within the app… • Dz://mylibrary/albums replaced by /MyLibrary/Albums -
The union of the deeplinks • One code to handle
in-app and out-app deeplinks • A unified way to get parameters (from URI and query parameters) -
The union of the deeplinks new DeezerUriMapping { UriRegex =
DeezerRuntimeSettings.BaseDeepLinkUrlRegEx + "?([a-z]*)?\\/album\\/(?<id>[0-9]*)", MappedUriTemplate = "/Pages/AlbumPage.xaml?id={id}", AutoMapQueryStringParameters = false }); -
The union of the deeplinks √ Views should not navigate
to views √ Unified way to address a view √ Being able to deeplink to a view √ Being able to change the view on the fly (gatekeeping, A/B testing, …) √ Integrate well in to the framework(s) Pass object instances between views -
Deeplinks & Friends I want to navigate to a view
/ an URI _navigationService.Navigate(protocolArgs.Uri.Origina lString, null); I want to navigate to a view, but I already have this object _navigationService.Navigate(PageTokens.AlbumPage, currentAlbum);