获得Facebook上传照片的许可 [英] get facebook extended permission for uploading photos
问题描述
在我的Facebook应用程序中,当用户第一次开始使用它时,该应用程序请求非常基本的权限。在稍后阶段,我需要延长许可才能允许应用上传照片,我只能在遗留的部分下载时才能上网:
In my facebook application, when the users first starts using it,the app request very basic permission. At a later stage, I need to request extended permission to allow the app to upload photos, I'm googling when falling only on the legacy part:
FB.Connect.showPermissionDialog("photo_upload",permissionHandler);
>
Does someone has any idea how to get permission for uploading photos using the new sdk??
推荐答案
要从用户获取扩展许可,有两种方式可以询问用户的权限。无论哪种方式,最终都是获得用户的许可:
To obtain extended permission from the user, there are two ways to ask the permission from the user. In either way, the finality is to get the permission from the user:
- 打开一个弹出窗口,并向用户询问扩展许可
FB.login(function(response){
if(response.authResponse){
// user is logged in并授予一些权限
} else {
//用户已取消登录或未完全授权
}
},{scope:'read_stream,publish_stream,offline_access'}) ;
FB.login(function(response) { if (response.authResponse) { // user is logged in and granted some permissions. } else { // User cancelled login or did not fully authorize. } }, {scope:'read_stream,publish_stream,offline_access'});
-
打开一个新窗口,向用户询问权限
Open a new window and ask the user the permission
window.location的=https://www.facebook.com/dialog/permissions.request?app_id=&next=https://apps.facebook.com//&type=user_agent&perms=user_photos,publish_stream ,friends_photos& fbconnect = 1;
window.location="https://www.facebook.com/dialog/permissions.request?app_id=&next=https://apps.facebook.com//&type=user_agent&perms=user_photos,publish_stream,friends_photos&fbconnect=1";
您还需要知道用户需要哪个权限。 这里是您可以从Facebook用户请求的许可清单
You also need to know which permission you want from the user. Here is a list of permission that you can ask from a facebook user
这篇关于获得Facebook上传照片的许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!