Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BBL - A story about mobile navigation in Deezer for Windows

BBL - A story about mobile navigation in Deezer for Windows

Christopher MANEU

September 16, 2015
Tweet

More Decks by Christopher MANEU

Other Decks in Technology

Transcript

  1. A story about
    mobile navigation
    in Deezer for Windows
    Christopher Maneu
    Brown Bag Lunch @ Deezer
    16/09/2015

    View Slide

  2. Why talking about navigation ?
    • Complex subject
    • Few guidances when your app scale (whenever the platform)

    View Slide

  3. 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)

    View Slide

  4. Our path

    View Slide

  5. 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)

    View Slide

  6. Deeplink all the things

    View Slide

  7. 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

    View Slide

  8. 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)

    View Slide

  9. Our path

    View Slide

  10. 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)

    View Slide

  11. Windows 8 Navigation, Reinvented
    dz://mylibrary/albums => typeof(AlbumsPage)

    View Slide

  12. 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)

    View Slide

  13. Our path

    View Slide

  14. 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

    View Slide

  15. Our path

    View Slide

  16. 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)

    View Slide

  17. The union of the deeplinks

    View Slide

  18. The union of the deeplinks
    new DeezerUriMapping
    {
    UriRegex = DeezerRuntimeSettings.BaseDeepLinkUrlRegEx
    + "?([a-z]*)?\\/album\\/(?[0-9]*)",
    MappedUriTemplate = "/Pages/AlbumPage.xaml?id={id}",
    AutoMapQueryStringParameters = false
    });

    View Slide

  19. 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

    View Slide

  20. Our path

    View Slide

  21. Deeplinks & Friends
    AlbumPageDescriptor
    PageType: type
    Mappings: string[]
    PageToken: PageToken Enum

    View Slide

  22. 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);

    View Slide

  23. What’s next ?
    AOP ?
    [Deeplink("deezer://album/(?\w+)",
    "deezer://www.deezer.com/album/(?\w+)")]
    [PageDescriptor(PageDescriptor.AlbumPage)]
    public class AlbumPage
    {
    }

    View Slide