获取阅读和发布权限的一个请求权限

2023-09-13 00:39:53 作者:最佳损友

在大家说这是不可能的,打开Spotify的应用程序,并按下与Facebook按钮的登入。

我不知道他们是怎么做的,我怎么能得到publish_stream和基本权限/电子邮件的一个请求。

此外,是否有可能对我来说,使用Facebook SDK重新打开一个Facebook会话,如果我从上届会议的某些信息(他们使用的应用程序最后一次)?

修改 -SCREENSHOTS以下是这些音乐AVERT

解决方案

你什么都看到了Spotify的不是 publish_stream 的结局。什么他们使用的是< A HREF =htt​​p://developers.facebook.com/docs/concepts/opengraph/>

打开图概念涉及整合的应用程序的行为与FB活动发布,并通过他们使用的应用程序的用户共享。了解更多关于它在上面提到的链接。

编辑 说明的: 检查的Open Graph权限

样品活动:

 公共类MainActivity扩展活动实现StatusCallback {

    @覆盖
    保护无效的onCreate(包savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.activity_main);
        OpenRequest打开=新OpenRequest(本);
        open.setLoginBehavior(SessionLoginBehavior.SUP preSS_SSO);
        open.setPermissions(Arrays.asList(新的String [] {电子邮件,publish_actions,user_birthday,user_hometown}));
        open.setCallback(本);
        会议S =新的Session(本);
        s.openForPublish(开);
    }

    @覆盖
    公共无效呼叫(会话的会话,SessionState会状态,例外的例外){
    }

    @覆盖
    保护无效onActivityResult(INT申请code,INT结果code,意图数据){
        super.onActivityResult(要求code,因此code,数据);
        如果(Session.getActiveSession()!= NULL)
            Session.getActiveSession()onActivityResult(这一点,要求code,因此code,数据)。
    }
}
 

此活动将显示此(如果没有登录的用户):

腾讯内容直播 电商直播权限开通流程全解

Before you all say it's not possible, open up the Spotify app and hit the signin with Facebook button.

I'm wondering how they did it, and how I can get "publish_stream" and basic permissions/email in one request.

Also, is it possible for me to reopen a Facebook session using the Facebook SDK if I have certain info from the last session (last time they used the app)?

EDIT -SCREENSHOTS BELOW FOR THE MUSICALLY AVERT

解决方案

What ever you saw on Spotify is not the outcome of publish_stream .What they have used is the Open Graph

Open graph concepts involves integrating actions of the app with the FB activity post and share with the users through the application they use. Read more about it at the above mentioned link.

Edits Explanation: Check the Open Graph Permissions

Sample Activity:

public class MainActivity extends Activity implements StatusCallback {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        OpenRequest open = new OpenRequest(this);
        open.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
        open.setPermissions(Arrays.asList(new String[]{"email", "publish_actions", "user_birthday", "user_hometown"}));
        open.setCallback(this);
        Session s = new Session(this);
        s.openForPublish(open);
    }

    @Override
    public void call(Session session, SessionState state, Exception exception) {
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(Session.getActiveSession()!=null)
            Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
    }
}

This activity will show this (if the user is not logged in):

 
精彩推荐
图片推荐