简体   繁体   English

Firefox OS特权应用上的Flurry Analytics

[英]Flurry analytics on Firefox OS privileged app

I have a Firefox OS app that makes calls to cross domain pages and downloads data to display on the app, wich all works fine because I used the systemXHR permission and appended the { mozSystem: true } on every XMLHttpRequest. 我有一个Firefox OS应用程序,该应用程序可以调用跨域页面并下载数据以显示在应用程序上,但是一切正常,因为我使用了systemXHR权限,并在每个XMLHttpRequest上附加了{mozSystem:true}。

Then I attached the Flurry script, made the FlurryAgent calls in the .js of the app and started recieving the info from the events on the Flurry Event Logs when I ran it on the Firefox OS Simulator. 然后,我附加了Flurry脚本,在应用程序的.js中进行FlurryAgent调用,并在Firefox OS Simulator上运行时开始从Flurry Event Logs中的事件中接收信息。 When I tried to install my app on a Firefox OS device, the Flurry session never starts and the app never loads. 当我尝试在Firefox OS设备上安装应用程序时,Flurry会话永远不会启动,并且应用程序也永远不会加载。

I don't understand why Flurry works on the simulator and not on the device. 我不明白为什么Flurry在模拟器上而不在设备上可以工作。 I checked a lot of times for the internet connection on the device, wich works fine for the browser and other apps that were already installed. 我检查了设备上的Internet连接很多次,对于浏览器和其他已安装的应用程序来说,它可以正常工作。 And my app worked fine on the device before I had attached Flurry. 在连接Flurry之前,我的应用在设备上运行良好。

Here is a sample of my code: 这是我的代码示例:

HTML: HTML:

<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>My App</title>
    <link rel="stylesheet" href="js/jquery.mobile-1.3.2.min.css" />
    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/jquery.mobile-1.3.2.min.js"></script>
    <link rel="stylesheet" href="css/mystyle.css" />
    <script src="https://cdn.flurry.com/js/flurry.js"></script>
    <script src="js/app.js"></script>


</head> 


<body> 

.js .js文件

$(document).on('pagebeforecreate', '[data-role="page"]', function(){    
    if ($(this).attr('id')=="splash"){
        $.mobile.allowCrossDomainPages = true;
    }
});
$(document).on('pageinit', '[data-role="page"]', function(){    
    console && console.log($(this).attr('id') + " - pageinit!!");
    if ($(this).attr('id')=="splash"){
        FlurryAgent.startSession("7ZFX9Z4CVT66KJBVP7CF"); //Here is were it crashes
        alert("Inicio sesion flurry");
        console && console.log($(this).attr('id') + "- Entro al if para el timer");
        var timer = window.setTimeout(next, 10000);
    } 
});

If there is anything else that you need to help me figure out what happens, let me know. 如果您还有其他需要帮助我确定会发生什么的情况,请告诉我。 The device I'm using is a Qualcomm model, especifically Peak and has the OS version: Boot2Gecko 1.1.1.0hd-GP 我使用的设备是Qualcomm型号,特别是Peak,并且具有以下操作系统版本:Boot2Gecko 1.1.1.0hd-GP

This may be a CSP issue. 这可能是CSP问题。 Have a look at: https://developer.mozilla.org/en-US/Apps/CSP?redirectlocale=en-US&redirectslug=Apps%2FCSP Specifically Remote scripts are banned. 看一下: https : //developer.mozilla.org/en-US/Apps/CSP?redirectlocale= en-US &redirectslug= Apps%2FCSP特别禁止远程脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM