我正在尝试通过Google帐户登录移动应用程序。
我收到此错误无效请求和原始参数值无效:缺少权限:file:// 。如何解决它可以请任何人帮助我。
我正在尝试在Android手机中检查我的应用程序,我得到以下错误。
var CLIENT_ID = '349212001841-0o5cf26ah1g7fc4ufsfa1unk0ph3qoab.apps.googleusercontent.com';
var SCOPES = [ 'https://www.googleapis.com/auth/gmail.readonly' ];
function checkAuth() {
gapi.auth.authorize({
'client_id' : CLIENT_ID,
'scope' : SCOPES.join(' '),
'immediate' : true
}, handleAuthResult);
}
function handleAuthResult(authResult) {
alert("success")
var authorizeDiv = document.getElementById('authorize-button');
if (authResult && !authResult.error) {
authorizeDiv.style.display = 'none';
loadGmailApi();
} else {
authorizeDiv.style.display = 'inline';
}
}
function handleAuthClick(event) {
alert("failure")
gapi.auth.authorize({
client_id : CLIENT_ID,
scope : SCOPES,
immediate : false
}, handleAuthResult);
return false;
}
function loadGmailApi() {
gapi.client.load('gmail', 'v1', listLabels);
}
function listLabels() {
var request = gapi.client.gmail.users.labels.list({
'userId' : 'me'
});
request.execute(function(resp) {
var labels = resp.labels;
appendPre('Labels:');
if (labels && labels.length > 0) {
for (i = 0; i < labels.length; i++) {
var label = labels[i];
appendPre(label.name)
}
} else {
appendPre('No Labels found.');
}
});
}
function appendPre(message) {
var pre = document.getElementById('output');
var textContent = document.createTextNode(message + '\n');
pre.appendChild(textContent);
}
&#13;
<div data-role="page" id="loginPage">
<div data-role="content" style="padding: 15px">
<h1 id="fb-welcome"></h1>
<label for="text">User Name:</label><input type="text" name="text" id="unL">
<label for="text">Password:</label><input type="password" name="text" id="pwdL">
<a href="#dashboardPage" data-role="button" id="appLogin()">LOGIN</a>
<a href="#" data-role="button" onclick="fbLogin()">via Facebook Login</a>
<a href="#" data-role="button" id="authorize-button" onclick="handleAuthClick(event)">via Google Login</a>
</div>
</div>
<div data-role="page" id="dashboardPage">
<div data-role="header" id="header" data-position="fixed">
<h3>DashBord</h3>
</div>
<div data-role="content" style="padding: 15px">
<a href="#" data-role="button" onclick='Logout();'>LogOut</a>
</div>
</div>
&#13;