P | Cast now has a custom URI scheme

When you want your app to become more popular you could enable other apps to launch your app. You can even go beyond just launching and even activating special features.

As you’ve probably read, P | Cast now has a Car Mode UI built in. So there are apps that are focused on Car Mode, which would want to launch P | Cast in it’s Car Mode. Even more, they might want to even start playing the music directly after launching the app.

That’s why adding a custom URI scheme for P | Cast was on my mind from the beginning, and now it’s there.

The basics of launching P | Cast

You can launch P | Cast in it’s normal UI, but also in Car Mode.

/// <summary>
/// Launch P | Cast in Normal UI
/// </summary>
private void Normal()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:NormalPlayer"));
}

/// <summary>
/// Launch P | Cast in Car Mode
/// </summary>
private void Car()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:CarPlayer"));
}

 

Launch P | Cast and start playing immediately

When we go beyond the basic launch, we can add a couple of additional URI elements to enable immediate playback on app launch.

To start playing the most recent track upon app launch use the below URIs.

/// <summary>
/// Launch P | Cast in Normal UI and immediately start playing the most recent track
/// </summary>
private void NormalPlayRecent()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:NormalPlayer?Play=Recent"));
}

/// <summary>
/// Launch P | Cast in Car Mode and immediately start playing the most recent track
/// </summary>
private void CarPlayRecent()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:CarPlayer?Play=Recent"));
}

 

And if you want the app to start playing a random track, use these.

/// <summary>
/// Launch P | Cast in Normal UI and immediately start playing a random track
/// </summary>
private void NormalPlayRandom()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:NormalPlayer?Play=Random"));
}

/// <summary>
/// Launch P | Cast in Car Mode and immediately start playing a random track
/// </summary>
private void CarPlayRandom()
{
    Windows.System.Launcher.LaunchUriAsync(new Uri("pcast:CarPlayer?Play=Random"));
}

 

If you’ve questions about integration of P | Cast in your app, please leave a message in the comments or contact me on the P | Cast twitter account.

  • Gravatar michael kors outlet April 10th, 2014 at 18:35
    Wow,such a wonderful show..we mentioned that you were very...just now...so .....
  • Gravatar top plumbers April 13th, 2014 at 03:54
    For hottest information you have to pay a quick visit
    world wide web and on internet I found this web page as a best site for most up-to-date updates.
  • Gravatar vans shoes outlet April 18th, 2014 at 20:09
    Just go and buy Vans shoes sale to meet your demand of running and climbing in this season,action to get one with low price now!<br><strong>Vans authentic leopard skate Shoes pink unisex</strong><a href=" http://www.shoesvansonuk.com/">Vans On uk</a></br>Sole: Rubber</br>Style: Skate Shoes</br>Colour: Pink, Black & White</br>Fastening: Lace Up</br>Upper Material: Canvas</br>Occasion: Casual
    vans shoes outlet http://www.shoesvansonuk.com/vans-era-pro-cruise-lose-royal-skate-trainerss-blue-gp55559-p-605.html
  • Gravatar 84400.pink2.net April 19th, 2014 at 04:22
    livraison très rapide - joli court 84400.pink2.net contre cette plage - conforme ensuite ok
Gravatar