3

我是新手機windows應用程序開發。是否有可能通過瀏覽器URL打開Windows Phone應用程序。如果可能的話,請有人幫助我。如何通過瀏覽器啓動windows手機應用程序url

How to implement my very own URI scheme on Android

請訪問上述網址;

但其在Android

<activity 
     android:name="TabHost" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <intent-filter> 
      <data android:scheme="myschema" /> 

      <action android:name="android.intent.action.VIEW" /> 

      <category android:name="android.intent.category.BROWSABLE" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
</activity> 

下面的代碼是Windows工作8桌面IE瀏覽器

,但它不是在Windows Phone

<Applications> 
<Application Id="SDKSample.App" Executable="$targetnametoken$.exe"          EntryPoint="SDKSample.App"> 
    <Extensions> 
    <Extension Category="windows.protocol"> 
     <Protocol Name="alsdkcs" m2:DesiredView="useLess"/> 
    </Extension> 
    <Extension Category="windows.fileTypeAssociation"> 
     <FileTypeAssociation Name=".alsdkcs" m2:DesiredView="useLess"> 
     <SupportedFileTypes> 
      <FileType>.alsdkcs</FileType> 
     </SupportedFileTypes> 
     </FileTypeAssociation> 
    </Extension> 
    </Extensions> 
    <m3:VisualElements DisplayName="Launcher API C# sample" Description="AssociationLaunching C# sample" ForegroundText="light" BackgroundColor="#00b2f0" Square150x150Logo="Assets\squaretile-sdk.png" Square44x44Logo="Assets\smallTile-Phone-sdk.png"> 
    <m3:DefaultTile ShortName="Launcher API C#" DefaultSize="square150x150Logo" Wide310x150Logo="Assets\tile-sdk.png" Square71x71Logo="Assets\mediumtile-sdk.png"> 
     <m3:ShowNameOnTiles> 
     <m3:ShowOn Tile="square150x150Logo"/> 
     <m3:ShowOn Tile="wide310x150Logo"/> 
     </m3:ShowNameOnTiles> 
    </m3:DefaultTile> 
    <m3:SplashScreen Image="Assets\splash-Phone-sdk.png" BackgroundColor="#00b2f0"/> 
    <m3:ApplicationView MinWidth="width320"/> 
    </m3:VisualElements> 
</Application> 

回答

2

工作可能您可以對Windows phone執行相同的操作 - 註冊自定義URI方案將打開你的應用程序。

這裏有一些資源給你:

+0

我曾嘗試在Windows Phone瀏覽器網址中粘貼mailto:[email protected]。我得到了不受支持的地址 – user3796642

+0

我已經嘗試了上述兩個網址中提到的一切,但只有我得到的東西是不受支持的地址 – user3796642

+0

爲什麼會這樣工作?你有沒有註冊你的應用程序的mailto URI?我不認爲這是可能的,但我可能是錯的。 –

3

地獄......我得到了答案。它的工作,如果我通過javascript

<input id="btnwindowsphone" type="button" class="button" name="" value="open windows phone"  onclick="javascript:loadwindowsphone();" /><br /><br /> 
function loadwindowsphone() { 
        window.location = 'alsdkcs://hd'; 
       } 
+0

不錯!很有用 !! – Flayn

0

本文檔本文適用於Windows Phone的8.1 ​​/ Windows Phone的10手機撥打:

https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh779670.aspx

如果你正在運行到不能夠的問題打開您註冊的URI方案很可能是因爲您試圖使用Internet Explorer/Edge打開它。這不起作用。

請發送一封包含該鏈接的電子郵件或將其放入OneNote中 - 只是一個外部地方,它實際上鍊接到瀏覽器。

否則,IE/Edge會將您的方案視爲http://myscheme/而不是myscheme://。

相關問題