可浏览意图停止工作

时间:2015-09-13 12:09:57

标签: android cordova android-intent phonegap-build

我尝试为我的应用程序编写一个可浏览的意图,该意图在调用特定网址时起作用:

 <gap:config-file platform="android" parent="/manifest/application" mode="add" >
        <!-- registers to receive SEND and VIEW intents from other apps -->
        <activity android:name="com.myAppName" android:label="@string/app_name">
            <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="http"
                      android:host="example.com"
                       />
                <data android:scheme="http"
                      android:host="www.example.com"
                       />
            </intent-filter>
        </activity>
    </gap:config-file>

那个DID工作(有点)。进入网址时,我收到一个弹出窗口,询问浏览器或我的应用是否应该打开该网址。

选择我的应用时,它会立即崩溃。但这不是我需要解决的问题。问题是,经过几次,我的设备停止问我哪个应用程序应该打开该URL。似乎有类似于&#34;后备&#34;在几次崩溃后阻止使用该URL?

我尝试重新安装我的apk并重启设备。我还清除了我的应用缓存。

有机会重新开始这项工作吗?

1 个答案:

答案 0 :(得分:0)

@Ole,
从您的帖子,您似乎想要阅读特定的URL。因此,您可能会碰到几个常见的路障。由于您未说明您是使用CLI还是云构建服务,因此此信息是通用的。

最好的起点是: Cordova / Phonegap新手的开发人员的主要错误
https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/new-to-Phonegap.md
你会想读#6,#7和&amp; #10。

您很可能需要实施 white-list 插件(#10),该插件允许您使用任何网址或预定义的一组网址。

您还需要开始在代码和插件中使用版本(#6&amp;#7)。如果在定义程序时不使用版本(无论是CLI还是Build - 通过config.xml),那么您将获得最新的代码,并且您将不断处理最前沿的问题。这意味着你的代码大部分时间都会工作,有时甚至根本不工作,有时候它会很好,有一天不会工作,然后再工作。在适当的地方使用版本。

最好的运气
杰西

相关问题