Ken Ekholm

Ken Ekholm

  • NA
  • 1
  • 861

Problems to open own developed UWP app with uri?

Jun 28 2016 4:07 AM
&nbsp;<p>I have tried to follow the instructions from this link https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/handle-uri-activation to register an uri for my application. But the app only open the logo and then automatically exit&nbsp;after an certian time when using this code.</p><pre class="prettyprint prettyprinted"><em><span class="kwd">private</span><span class="pln"> async </span><span class="kwd">void</span><span class="pln"> buttonInternetRadio_Click</span><span class="pun">(</span><span class="kwd">object</span><span class="pln"> sender</span><span class="pun">,</span><span class="pln"> </span><span class="typ">RoutedEventArgs</span><span class="pln"> e</span><span class="pun">)</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln"></span><span class="pun">{</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln"></span><span class="kwd">var</span><span class="pln"> uri </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Uri</span><span class="pun">(</span><span class="str">"testapp://"</span><span class="pun">);</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln"></span><span class="kwd">var</span><span class="pln"> options </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Windows</span><span class="pun">.</span><span class="typ">System</span><span class="pun">.</span><span class="typ">LauncherOptions</span><span class="pun">();</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln">options</span><span class="pun">.</span><span class="typ">TreatAsUntrusted</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln"></span><span class="kwd">var</span><span class="pln"> success </span><span class="pun">=</span><span class="pln"> await </span><span class="typ">Windows</span><span class="pun">.</span><span class="typ">System</span><span class="pun">.</span><span class="typ">Launcher</span><span class="pun">.</span><span class="typ">LaunchUriAsync</span><span class="pun">(</span><span class="pln">uri</span><span class="pun">,</span><span class="pln"> options</span><span class="pun">);</span></em></pre><pre class="prettyprint prettyprinted"><em><span class="pun"></span><span class="pln"></span><span class="pun">}</span></em></pre><p>In Declarations part of Package.appxmanifest I have the&nbsp;following properties,</p><p>Logo: testapp.png</p><p>Display Name: Test App</p><p>Name: testapp</p><p>Can someone help me with this issue?</p>

Answers (1)