0
チタニウムモバイルに慣れてきて、今ではiOSアプリを開発しています。チタニウムモバイルのFacebookカスタムログイン
カスタムログインボタンを作成したいと思います。 私はウェブ上のいくつかの指示に従ったが、それでも動作していない。 コードは次のとおりです。
var win = Ti.UI.currentWindow;
Titanium.Facebook.appid = "APP ID";
Titanium.Facebook.permissions = ['permissions here'];
var login = Ti.UI.createButton({
backgroundImage:'facebooklogin.png',
width:250,
height40:
});
win.add(login);
login.addEventListener('click', function(e) {
Titanium.Facebook.authorize();
});
Titanium.Facebook.addEventListener('login', function(e) {
if (e.success) {
Titanium.Facebook.requestWithGraphPath('me', {}, 'GET', function(e) {
if (e.success) {
var data= JSON.parse(e.result);
Ti.API.info("Name:"+data.name);
Ti.API.info("email:"+data.email);
Ti.API.info("facebook Id:"+data.id);
} else if (e.error) {
alert(e.error);
} else {
alert('Unknown response.');
}
});
}else{
if(e.error){
alert(e.error);
}else{
alert("Unkown error while trying to login to facebook.");
}
}
});
}
誰でも私に解決策を示しますか?
ありがとうございました。
エラーは何ですか? – DannyM
ああ、私はそれについて書くのを忘れてしまった。 ボタンをクリックすると、何も起こりません。私はFacebookのログインについてのモーダルウインドウが来ると思ったが、.... – user1258134