0
我有一個Facebook應用程序,我已經包含了Facebook Javascript SDK,它的工作原理相當不錯。FB Open Graph用戶對象的圖片url有效多久?
我在問用戶的基本權限,我希望我的應用程序在用戶配置文件上的圖片對象後查詢。
這是我的代碼:
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me/picture?type=square', function(response) {
if(!response.data.is_silhouette){
var url = response.data.url; // For how long will this data exist?
console.log('You have an avatar on your profile!');
}else{
console.log('You have no avatar uploaded to your profile!');
}
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
它獲取配置文件顯示圖片。 但是,我的照片有多長時間的網址有效?我預計URL只是暫時的。
感謝您的回答,所以如果我添加寬度和高度等參數。它仍然是一個靜態網址? – MrZiggyStardust
我是這麼說的,是的。畢竟你總是得到一個靜態的,我認爲它是在你第一次使用特定的寬度/高度時生成的。 – luschn
謝謝,你的答案標記爲答案! – MrZiggyStardust