[英]Flurry analytics on Firefox OS privileged app
我有一個Firefox OS應用程序,該應用程序可以調用跨域頁面並下載數據以顯示在應用程序上,但是一切正常,因為我使用了systemXHR權限,並在每個XMLHttpRequest上附加了{mozSystem:true}。
然后,我附加了Flurry腳本,在應用程序的.js中進行FlurryAgent調用,並在Firefox OS Simulator上運行時開始從Flurry Event Logs中的事件中接收信息。 當我嘗試在Firefox OS設備上安裝應用程序時,Flurry會話永遠不會啟動,並且應用程序也永遠不會加載。
我不明白為什么Flurry在模擬器上而不在設備上可以工作。 我檢查了設備上的Internet連接很多次,對於瀏覽器和其他已安裝的應用程序來說,它可以正常工作。 在連接Flurry之前,我的應用在設備上運行良好。
這是我的代碼示例:
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文件
$(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);
}
});
如果您還有其他需要幫助我確定會發生什么的情況,請告訴我。 我使用的設備是Qualcomm型號,特別是Peak,並且具有以下操作系統版本:Boot2Gecko 1.1.1.0hd-GP
這可能是CSP問題。 看一下: https : //developer.mozilla.org/en-US/Apps/CSP?redirectlocale= en-US &redirectslug= Apps%2FCSP特別禁止遠程腳本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.