标签: webintents

Android应用程序启动更新与cordova-webintent并强制停止

步骤: 1)打开Android应用程序(内置cordova)

2)然后我呼吁cordova-webintent安装更新 https://github.com/Initsogar/cordova-webintent

3)我按下Install并开始安装,但几秒后app强制停止并关闭而不是安装并打开更新的应用程序.

这个问题出现在前一段时间,我无法理解为什么会发生这种情况,因为同一版本的cordova-webintentcordova.

4)应用程序强制停止后,我点击应用程序图标,但是有一条消息"未安装应用程序".几秒后,应用程序继续在后台安装.我再次点击应用程序图标,打开更新的应用程序.

请帮助修复安装时app force stop的问题.

日志:

E:\ work\hello1> adb logcat ActivityManager:我com.example.hello1:D*:S

---------系统的开头

I/ActivityManager(715):[后台服务优先级调整]将service.getFlags()的callerFg设置为false:260

I/ActivityManager(715):START u0 {act = android.intent.action.VIEW dat = file:///storage/emulated/0/filename1.apk typ = application/vnd.android.package-archive cmp = com.来自uid 10657的android.packageinstaller/.PackageInstallerActivity}显示0

---------主要的开始

I/ActivityManager(715):从uid 10072上显示0 I/ActivityManager START u0 {dat = file:///storage/emulated/0/filename1.apk cmp = com.android.packageinstaller/.InstallAppProgress(has extras)} (715):[AppLaunch]显示显示的com.android.packageinstaller/.InstallAppProgress:+ 135ms

I/ActivityManager(715):强制停止com.example.hello1 appid = 10657 user = -1:uninstall pkg

I/ActivityManager(715):Killing 19149:com.example.hello1/u0a657(adj 1):stop com.example.hello1

W/ActivityManager(715):通知应用程序开关退出packageName = com.example.hello1 I/ActivityManager(715):强制完成活动ActivityRecord {16a2ad7e u0 com.example.hello1/.MainActivity t2758}

I/ActivityManager(715):强制完成活动ActivityRecord {32eb6933 u0 com.android.packageinstaller/.InstallAppProgress …

android install updates cordova webintents

34
推荐指数
1
解决办法
804
查看次数

Twitter Web Intent的内容安全策略问题

我有一个生成随机引号的网页,我有一个按钮,当点击它时,应该重定向到Twitter网页意图页面,以便允许观众发送已经预先填充了引用文本的推文.

按钮的代码:

<a class="btn btn-info btn-lg" href="#" data-size="large" 
id="tweet-button"><i class="fa fa-twitter"></i>Tweet the current quote!</a>
Run Code Online (Sandbox Code Playgroud)

单击按钮时的jQuery将修改按钮的"href"属性,以便将预先填充的文本添加到URL中以显示它.

$("#tweet-button").click(function (){
    $(this).attr("href", "https://twitter.com/intent/tweet?text=" + encodeURIComponent($("#quote").text()) );
}); 
Run Code Online (Sandbox Code Playgroud)

当我单击按钮时出现此错误:

Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src
https://connect.facebook.net https://cm.g.doubleclick.net 
https://ssl.google-analytics.com https://graph.facebook.com  
https://twitter.com https://*.userzoom.com 'unsafe-eval' 
https://*.twimg.com https://api.twitter.com https://analytics.twitter.com 
'nonce-6B1Ck//9/fE6OIatYBYe4A==' https://ton.twitter.com  
https://syndication.twitter.com https://www.google.com 
https://t.tellapart.com https://platform.twitter.com https://www.google-
analytics.com 'self'". Either the 'unsafe-inline' keyword, a hash 
('sha256-<sha256-hash'), or a nonce ('nonce-...') is required to enable 
inline execution
Run Code Online (Sandbox Code Playgroud)

如果我在URL中包含静态文本而不是$("#quote").text()正常加载,但无法弄清楚原因.在这两种情况下,我都应该得到CSP错误.

javascript webintents twitter-bootstrap-3

6
推荐指数
0
解决办法
833
查看次数

phonegap resolveLocalFileSystemURL不适用于android上的内容uri

我想在Android版本5.1.1上使用Nexus 4手机从Android图片库接收分享图片.我正在使用phonegap 4.2和一个phonegap WebIntent插件github链接和phonegap文件插件文档链接.

文本和链接工作正常,但当我尝试从Android库共享图像时,我得到一个这样的URI:

内容://com.google.android.apps.photos.contentprovider/0/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F63131/ACTUAL

而不是像file:/// ....

我尝试使用window.resolveLocalFileSystemURL函数来解析这个使用fileEntry对象返回成功的url.但是,当我尝试使用它来读取文件时,我收到代码1000的错误(参见下面的代码和输出).

有趣的是,如果通过img标签显示此URL,我可以看到图像正常.

<img src="" id="test_intent_image">
$('#test_intent_image').attr("src",uri);
Run Code Online (Sandbox Code Playgroud)

这表明问题可能是window.resolveLocalFileSystemURL函数无法处理内容:// ...正确输入uris?

=====参考信息======

这是我正在使用的代码(注意:我尝试使用其他文件函数,如copyTo()到app文件夹,但它给出了相同的错误):

    document.addEventListener("deviceready", shared, false);
    document.addEventListener("resume", shared, false);


 function shared () {

window.plugins.webintent.getExtra(window.plugins.webintent.EXTRA_STREAM,
function(data) {
// data is the value of EXTRA_TEXT
    if (! data) {
        return;
    }

    window.resolveLocalFileSystemURL(
        data, 
        function (entry) {
            console.log('file entry: ' + JSON.stringify(entry, null,3) );

            function win(file) {
                var reader = new FileReader();
                reader.onloadend = function (evt) {
                    console.log("file read success");
                    console.log(evt.target.result);
                };

                reader.readAsText(file);
            }; …
Run Code Online (Sandbox Code Playgroud)

android uri image cordova webintents

5
推荐指数
1
解决办法
6640
查看次数

UPI 是否支持 Apple IOS 上的深度链接

通过使用“意图”的深度链接,人们可以从您的应用程序发起付款,并在 Tez、BHIM、PhonePe 等支持 UPI 的应用程序中完成付款。这是由于 Android Intent API 启用的。我在 IOS 上没有找到类似的东西。另外,我在 NPCI 规范文档中没有发现任何提及 IOS 的深度链接支持。

deep-linking ios webintents upi

5
推荐指数
0
解决办法
989
查看次数

如何从 ionic4 应用程序启动外部应用程序

我的应用程序在 Ionic 4 for android 下,我必须打开/运行/启动外部应用程序(例如 com.google.android.youtube 或 com.sygic.truck)-> 例如,任何已安装的应用程序。

我测试了许多选项但没有成功:

InAppBrowserModule(使用 application://my.package.name)。

Cordova 插件lampaa(我没有找到在angular/ts 应用程序类型下使用它的任何方法)。

我还尝试使用包选项和操作选项调用主活动的 webIntent。


对于 InAppBrowserModule,我坚持使用附加在我的应用程序 url 之前的 http:// 协议。

对于Lampaa,我坚持使用未定义的startApp(即使在遵循其他线程建议之后)。

对于 webIntent,我认为这与我的问题无关。

有什么建议 ?

提前致谢 !


[编辑]

我终于让它工作了!

您可以使用以下两行之一:

 this.iab.create('android-app://com.google.android.youtube',"_system");

 window.open('android-app://com.google.android.youtube',"_system");
Run Code Online (Sandbox Code Playgroud)

您可以用任何应用程序包名称替换 com.google.android.youtube !

android cordova webintents ionic-framework ionic-native

5
推荐指数
1
解决办法
5324
查看次数

我如何确认发送了Twitter网络意图?

我想在点击Twitter Web Intent后确认用户发推文.我怎么能做到这一点?

例:

<a href="https://twitter.com/intent/tweet?text=Simple+Web+Intent">Tweet</a>
Run Code Online (Sandbox Code Playgroud)

假设匿名*用户点击此链接和推文,我该如何确认?

理想情况下,我希望获得推文的链接.


*anonymous在我的网站上未经过身份验证且不知道他们的Twitter用户名

twitter webintents

4
推荐指数
1
解决办法
2612
查看次数