<a class="grey-text text-lighten-3" target="_blank" href="javascript:void(0);" onclick="document.write(yourOS())">Instagram</a>
function yourOS() {
var ua = navigator.platform.toLowerCase();
if (ua.indexOf("android") != -1) {
document.write(.link("instagram://user?username=owendunnigan"));
} else {
.link("http://www.instagram.com/OwenDunnigan");
}
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试将应用程序深层链接到我的网站,但我不知道如何让它转到计算机上的常规旧 Instagram,然后转到 Android 或 iOS 设备上的应用程序。我知道这些链接有效,因为我单独尝试过它们。
intent-filter我在我的节点中定义了一个数据标签,AndroidManifest.xml如下所示:
<data
android:scheme="http"
android:host="example.com"
android:pathPrefix="/path/pageEnum" />
Run Code Online (Sandbox Code Playgroud)
我想要捕捉的路径是http://example.com/path/pageEnum?one=1&two=2&three=3
adb我正在这样启动意图:
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "http://example.com/path/pageEnum?one=1&two=2&three=3"
目标活动已成功启动,但是当我调用getIntent().getDataString()字符串onCreate()值时http://example.com/path/pageEnum?one=1
除第一个查询参数之外的所有查询参数都将被删除。
是否有任何解决方法可以确保我获得所有查询参数?
谷歌的文档中没有任何关于此行为的内容。
我已经在我的反应本机应用程序中实现了分支。平台中的所有链接均已设置,我在 URL 中看到了我需要的参数。我遇到的问题是当应用程序首次安装时该值为空。只有在我安装后,然后返回到它识别此参数的链接。这是预期的行为吗?
我如何在初始加载组件中设置分支调用。我将其添加到 componentDidMount() 中,因为我正在使用 redux 并且想要提醒 redux 该值。
componentDidMount(){
branch.subscribe(({params, uri, error}) => {
if (params && !error) {
if(params.coid != null){
const id = params.coid
this.showAlertMessage(
'BUNDLE COMPANY ID',
id
)
this.props.CheckAdmin(id)
LocalStore.get('localID').then(localID => {
LocalStore.save('localID', {value: id});
})
}
}else{
this.showAlertMessage(
'BUNDLE COMPANY ID',
"BUNDLE COID IS NULL"
)
this.props.IsMasterDownload()
}
this.showAlertMessage(
'BRANCH URI',
uri
)
})
}
Run Code Online (Sandbox Code Playgroud)
Branch.subscribe 是否需要位于我的组件类之外才能正常运行?
我想使用 Firebase 动态链接创建深层链接。
我已阅读文档,为了使用 REST API 创建深层链接,需要使用 JSON 对象创建 HTTP POST 请求,如下所示:
{"dynamicLinkInfo":
{
"dynamicLinkDomain": "abc123.app.goo.gl",
"link": "https://example.com/",
"androidInfo": {
"androidPackageName": "com.example.android"
},
"iosInfo": {
"iosBundleId": "com.example.ios"
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是 - 我想在链接内向应用程序发送附加数据。我该怎么做?谢谢!
在我的应用程序中,我想使用deeplink。当添加intent-filter了深层链接的启动activity,不见了应用程序图标到应用程序抽屉里!
但是当删除深层链接 时,将intent-filter应用程序图标显示到应用程序抽屉中。
清单代码:
<activity android:name=".Pages.Splash.SplashPage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- DeepLink -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
<data
android:host="example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
使用以上代码时,不在应用程序抽屉中显示应用程序图标,而是从manifest显示图标中删除以下代码时。
<!-- DeepLink -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
<data
android:host="example.com"
android:pathPrefix="/gaming" …Run Code Online (Sandbox Code Playgroud) 我正在尝试打开我用移动 Chrome 浏览器制作的应用程序。
https://developer.chrome.com/multidevice/android/intents
从这个链接,我想我必须使用“意图:”语法来完成这项工作。
但是,我的应用程序无法打开。相反,它会打开 Google Play 商店,但商店只显示“找不到项目”页面。
我很想知道我是否做错了什么。
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="myscheme" android:host="myhost" android:path="/"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
这是我写的意图过滤器。
var androidIntentUrl = 'intent://myhost/#Intent;scheme=myscheme;package=my.test.app.package;end';
if(!isIOS && isChromeAndBiggerThanVer25()) {
location.href = androidIntentUrl;
}
Run Code Online (Sandbox Code Playgroud)
这是我在网上写的。
必须在 Play 商店发布应用才能实现这一目标吗?
我还不太明白全部内容。
我想知道怎么了。
PS)名称“myscheme”和“myhost”只是我为写这个问题而编造的名称。我的代码中的实际名称与我的项目设置中写入的名称以及所有名称相匹配,包括包名称。
android google-chrome deep-linking android-manifest android-intent
我需要一个用于开发的 Expo 静态深层链接,用于与 3rd 方 (Cognito) 进行 Oauth 重定向
我已经使用过,Linking.makeUrl()但这会返回一个带有动态本地 ipaddress exp://10.0.0.107:19000 的深层链接,这对于团队中的其他开发人员来说是不一致的。
文档位于:https : //docs.expo.io/versions/latest/workflow/linking/#linking-module
说各种环境链接看起来像
在世博客户端发布的应用程序: exp://exp.host/@community/with-webbrowser-redirect
独立发布的应用程序: myapp://
发展: exp://wg-qka.community.app.exp.direct:80
我已经尝试过该开发链接,但无法打开。
我在 Android Studio 中启动了一个新项目并将其添加到我的androidmanifest.xml:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="www.example.com"
android:pathPrefix="/gizmos"
android:scheme="http"/>
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
然后我转到 Google Chrome 并输入:http://www.example.com/gizmos。该应用程序打不开。然后尝试命令行:
mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -n eu.theappfactory.deeplinktest/MainActivity
Starting: Intent { cmp=eu.theappfactory.deeplinktest/MainActivity }
Error type 3
Error: Activity class {eu.theappfactory.deeplinktest/MainActivity} does not exist.
Run Code Online (Sandbox Code Playgroud)
和这个:
mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -W -a android.intent.action.VIEW -d "http://www.example.com" eu.theappfactory
Starting: Intent { act=android.intent.action.VIEW dat=http://www.example.com/... pkg=eu.theappfactory }
Error: Activity …Run Code Online (Sandbox Code Playgroud) 我有一个网址,例如https://www.mobilePhoneSystem.com/{user}/registerDate/{date}。所以{user}路径前缀是动态的。我只需要处理包含registerDate. 我在清单中写了这样的内容
<!-- Deep linking-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="/www.mobilePhoneSystem.com"
android:pathPrefix="/registerDate" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
但它不会触发。当我在 mainfest 中添加任何用户时,例如pathPrefix=/user111/registerDate,它会触发并正常工作。但用户是动态的。那么我该如何处理这种类型的深层链接呢?
我正在尝试使用 build.gradle 将 url 架构和路径动态注入到我的 AndroidManifest.xml 文件中作为参考
但是,这不允许触发深度链接。
当我在 AndroidManifest.xml 中使用静态值时,我测试了深度链接的工作情况。
// AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="${appScheme}"
android:host="${hostName}"
android:path="/path2" />
<data
android:scheme="${appScheme}"
android:host="${hostName}"
android:path="/path1" />
</intent-filter>
// build.gradle (:app)
defaulConfig {
manifestPlaceholders = [
hostName: "www.host_name.com",
appScheme: "https"
]
}
demo {
resValue "string", "hostName", "www.host_demo.com"
resValue "string", "appScheme", "https"
}
staging {
resValue "string", "hostName", "www.host_staging.com"
resValue "string", "appScheme", "http"
}
Run Code Online (Sandbox Code Playgroud) deep-linking ×10
android ×8
javascript ×2
react-native ×2
branch.io ×1
expo ×1
firebase ×1
html ×1
intentfilter ×1
java ×1
manifest ×1
uri ×1