0

Не удалось получить канал google; он не загружается. Он отлично работает в браузере, не оставляя библиотеки телефонных разговоров и т. д. В любом случае, это код. -Невозможно получить канал google в приложении phonegap

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8" /> 
<meta name="format-detection" content="telephone=no" /> 
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --> 
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> 
<link rel="stylesheet" type="text/css" href="css/index.css" /> 
<title>Testly</title> 
</head> 
<body> 
<div class="app"> 
<h1>PhoneGap</h1> 
<div id="deviceready" class="blink"> 
<a href="#" onclick="var ref = window.open('http://cnn.com', '_blank', 'location=yes,toolbar=yes');">CNN Link</a> 
</div> 
<div class="f">loading...</div> 
<script type="text/javascript" src="phonegap.js"></script> 
<script> 
document.addEventListener("deviceready", onDeviceReady, false); 
function onDeviceReady() { 
document.addEventListener("backbutton", function (e) { 
e.preventDefault(); 
}, false); 
} </script> 
<script type="text/javascript" src="js/index.js"></script> 
<script type="text/javascript" src="https://www.google.com/jsapi"></script> 
<script type="text/javascript">        /*feed control*/ 
google.load("feeds", "1", {'nocss' : 1}); 
function OnLoad() { 
var feedControl = new google.feeds.FeedControl(); 
feedControl.setNumEntries(25); 
feedControl.addFeed("http://feeds.feedburner.com/Techcrunch"); 
feedControl.draw(document.querySelector(".f")); 
} 
google.setOnLoadCallback(OnLoad); 
</script> 
<style> 
.f{ 
margin:20px; 
overflow:scroll; 
width:400px; 
height:400px; 
} 
</style> 
<script type="text/javascript"> 
app.initialize(); 
</script> 
</body> 
</html> 

Это не может загрузить каналы, Evrything остальное работает нормально.

+0

У вас есть все, что вам нужно? –

+0

Да. Канал отлично работает в браузере. Я думаю, что это конфликт с js. – Mario

+0

Проблема может заключаться в том, что вы используете 'https: // ...' для извлечения JSAPI Google, попробуйте просто использовать 'http: // ...'. Я видел много проблем с людьми, которые пытаются использовать HTTPS-ссылки в PhoneGap. –

ответ

0

Благодарим за помощь @Drew @divoto. Проверено с помощью firebug и whitelisted все возможные домены; которые ранее не были белыми. Вот список-

<access origin="*.google.com" /> 
    <access origin="*.googleapis.com" /> 
    <access origin="*.gstatic.com" /> 
    <access origin="*.googleusercontent.com" /> 
    <access origin="google.com" subdomains="true"/> 
    <access origin="googleapis.com" subdomains="true"/> 
    <access origin="gstatic.com" subdomains="true"/> 
    <access origin="googleusercontent.com" subdomains="true"/> 
Смежные вопросы