2017-02-15 19 views
4

我正在做一個角1.4.2的應用程序,並希望模仿instagram移動網站的行爲來打開應用程序,當我點擊按鈕的Instagram打開,這可能嗎?如何讓Instagram「在應用中打開」按鈕?

enter image description here

我已經嘗試過的舊帖子的解決方案,但似乎沒有工作。我不知道這是一個角度問題還是他們不工作了。 舊文章:

更多的是我的嘗試,並沒有工作細節:

<a href="instagram://media?id=434784289393782000_15903882">instagram://media?id=434784289393782000_15903882</a> 
<a href="http://instagram.com/_u/{USERNAME}/">Link to Instagram Page</a> 
<a href="instagram://user?username={USERNAME}">Link to Instagram Profile</a> 
<a href="intent://instagram.com/_n/mainfeed/#Intent;package=com.instagram.android;scheme=https;end"> test open Instagram ANDROID</a> 
<a href="http://instagram.com/_u/USERNAME/">visit our instagram page</a> 
<a href="instagram://user?username=untitled.tiff">untitled.tiff</a> 
<a href="instagram://app">Open Instagram</a> 
+0

「沒有任何工作」對於問題的描述是不夠的。發佈你使用的代碼和發生的事情。 –

+1

您發佈的鏈接,2.打開應用程序選擇(instagram/chrome),3.工作正常,4.也,(意向鏈接),5.也打開選擇 - 在Android 6.0.1上最新的Chrome上測試 –

+0

你是對的,我一定是做錯了,現在它的工作號碼3.非常感謝! –

回答

2

我進一步嘗試和這個環節結束工作。

<a href="instagram://user?username={USERNAME}">Link to Instagram Profile</a> 

此外,我不得不添加刪除角不斷添加的「不安全:」標記。

var app = angular.module('myApp', []) 
.config([ 
    '$compileProvider', 
    function($compileProvider) 
    { 
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(http|https?|local|data|instagram):/); 
    } 
]); 
相關問題