发送邀请Facebook的朋友加入我的网站 [英] send an invitation to facebook friends to join my website

查看:239
本文介绍了发送邀请Facebook的朋友加入我的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立我已经使用 Facebook的SDK集成功能NEW一个Android应用程序 package.I've也succeded在我的应用程序来获取所有的名字我的Facebook 朋友,其名称的ID 。进一步我想从我的应用程序的邀请发送给所有的Facebook好友加入website.Canü点我在正确的方向,因为我还没有发现对internet.Thank你什么

I have build an android application in which I've integrated faceboook using the facebook-sdk package.I've also succeded to retrieve in my application the name of all my facebook friends, their names and their id's.Further I want to send from my application an invitation to all facebook friends to join a website.Can u point me in the right direction cause I haven't found anything on the internet.Thank you

推荐答案

尝试使用下面的code,如果你按照我给你在你的另一个问题教程,将工作没有probs!

Try using the code below, if you follow the tutorials i gave you in your other question it will work no probs!

protected void postOfferToWall(String userID){
    try {
        if (isSession()) {
            String response = mFacebook.request((userID == null) ? "me" : userID);

            Bundle params = new Bundle();
            params.putString("message", "message goes here");
            params.putString("link", "http://mysite.com");    
            params.putString("caption", "Click the link");
            params.putString("description", "description of link"); 
            params.putString("name", "name of link");
            params.putString("picture", "http://url.to.my.picture/pic.jpg");

            response = mFacebook.request(((userID == null) ? "me" : userID) + "/feed", params, "POST");       

            Log.d("Tests",response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
                Log.v("Error", "Blank response");
            }
        } else {
            // no logged in, so relogin
            Log.d(TAG, "sessionNOTValid, relogin");
            mFacebook.authorize(this, PERMS, new LoginDialogListener());
        }
    }catch(Exception e){
        e.printStackTrace();
    }
}

这篇关于发送邀请Facebook的朋友加入我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆