想要在APP中加入與Facebook互動的功能,最方便的應該就是用Graph API 了!
而Titanium則把這件事情幫我們都準備好了,所以一旦用Titanium.Facebook.loggedIn做完登入的動作後,就可以用Titanium.Facebook.requestWithGraphPath來使用facebook的Graph API。
像是要取得使用者資料:
Titanium.Facebook.requestWithGraphPath('me', {}, 'GET', function(e) {
if (e.success) {
//something...
else if (e.error) {
//something....
}
});
![[weLunch]菜單內容](https://justfly.idv.tw/wp-content/uploads/2011/08/31-200x300.jpg)