get facebook extended permission for uploading photos

房东的猫 提交于 2019-12-02 08:31:31

问题


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??


回答1:


There is no photo_upload permission. But, you can upload photos using the publish_stream permission instead. And you can see the user's photos using the user_photos permission.




回答2:


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:

  1. Opens a popup and ask the user the extended permission

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'});

  1. 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";

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



来源:https://stackoverflow.com/questions/10802197/get-facebook-extended-permission-for-uploading-photos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!