相关疑难解决方法(0)

从Android浏览器启动自定义Android应用程序

任何人都可以指导我如何从Android浏览器启动我的Android应用程序?

android intentfilter android-intent

403
推荐指数
10
解决办法
31万
查看次数

如何从Web应用程序打开本机iOS应用程序

总结我有一个具有正确功能的URL方案的应用程序,我想从主屏幕上存储的Web应用程序启动,而普通的JavaScript重定向方法似乎不起作用.

详细信息我正在尝试创建一个iOS网络应用程序,从主屏幕上保存的链接以全屏模式打开.Web应用程序需要打开特定的本机应用程序.我已经为本机应用程序注册了url方案,并验证它是否正常工作 - 例如,我可以通过直接在我的Safari地址栏中键入方案来打开本机应用程序.我也可以使用+openURL:方法从其他应用程序打开它UIApplication.我还想用可以添加到主屏幕的本机Web应用程序中的某些参数打开它.

我想要做的是在本机应用程序中使用这样的JavaScript:

window.location = "myapp://myparam";
Run Code Online (Sandbox Code Playgroud)

在Web应用程序中使用此代码时,我会收到一条提示:

"无法打开myWebAppName - 无法打开myWebAppName.错误是"此URL无法显示"."

在Safari中执行时,这个相同的JavaScript工作正常.我得到了相同的结果window.location.replace("myapp://myparam").

Web应用程序的html是:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>untitled</title>
    <meta name="generator" content="TextMate http://macromates.com/">
    <meta name="author" content="Carl Veazey">
    <!-- Date: 2012-04-19 -->
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
</head>
<body>
    <script type="text/javascript" charset="utf-8">
        if (window.navigator.userAgent.indexOf('iPhone') != -1) {
            if (window.navigator.standalone == true) {
                window.location …
Run Code Online (Sandbox Code Playgroud)

javascript mobile-safari ios

28
推荐指数
2
解决办法
7万
查看次数

打开电子邮件应用程序网址

我想添加链接到我的网站“检查您的电子邮件”。如果用户使用 mob 版本链接,则应在浏览器中打开邮件应用程序或电子邮件服务 URL(如果应用程序不存在)。例如用户有 test@gmail.com。如果用户没有 Gmail 应用程序,链接应在浏览器中打开 gmail 应用程序或https://mail.google.com。也许最好启动用户首选的邮件应用程序而不是 gmail。

安卓

我发现https://developer.chrome.com/multidevice/android/intents带有意图链接 intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;S.browser_fallback_url=http %3A%2F%2Fzxing.org;end

它工作正常,但我无法理解如何使用https://play.google.com/store/apps/details?id=com.google.android.gm&hl=ru或任何其他应用程序做同样的事情

我还发现https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND打开邮件应用程序但 intent://send#Intent;action=android.intent.action.SEND;end 不起作用

任何人都可以给我打开 Gmail 应用程序或默认邮件应用程序的工作网址吗?

操作系统

通用链接https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12

互联网上有很多关于如何将您的网站与您的应用程序链接的文章。但是如何从我的网站启动另一个应用程序?

android android-intent ios web ios-universal-links

12
推荐指数
1
解决办法
2万
查看次数

如何重定向回Android应用?

我需要打开自定义Chrome标签,将用户带到我的网站,然后将用户重定向回应用.它类似于为OAuth启动页面.

这是Android方面的样子......

AndroidManifest.xml(将意图过滤器添加到用于侦听URI的活动)

<activity android:name=".app.MyActivity"
        android:label="@string/title"
        android:theme="@style/AppTheme"
        android:launchMode="singleTask"
        android:screenOrientation="portrait">

        <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="mytest" />
        </intent-filter>

    </activity>
Run Code Online (Sandbox Code Playgroud)

Activity.java(启动自定义chrome选项卡)

private void goToSite() {
    CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
    int toolbarColor = getResources().getColor(R.color.primary);
    intentBuilder.setToolbarColor(toolbarColor);vice_key(), shared().getAccessToken());
    intentBuilder.build().launchUrl(this, Uri.parse("https://example.com/some-page"));
}
Run Code Online (Sandbox Code Playgroud)

在我的服务器上,用户完成一个表单并最终被带到一个页面,该页面应该将它们重定向回应用程序...

server.html

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<script>
    var redirectToApp = function() {
        setTimeout(function appNotInstalled() {
            window.location.replace("http://example.com/app-not-installed");
        }, 100);
        window.location.replace("mytest://justanexample");
    };
    window.onload = redirectToApp;
</script>
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)

但我没有被重定向到应用程序.我怀疑我的服务器代码有问题,因为类似的设置(清单和活动代码)在处理OAuth页面时有效.我的服务器代码有什么问题?我该如何解决这个问题?

编辑

Android端似乎是正确的 - …

redirect android webview google-oauth google-oauth2

3
推荐指数
1
解决办法
2378
查看次数