简体   繁体   English

通过facebook sdk将应用程序中的文本发送给朋友

[英]Sending text from app to friend via facebook sdk

I have this activity with an edittext that the user can write a short text inside, then when done a new activity opens up with a listview that fetches facebook friends, i bring the text like this: 我有一个edittext活动,用户可以在里面写一个简短的文本,然后当一个新的活动打开时,一个listview提取Facebook好友,我带来这样的文字:

@Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            EditText etLocation = (EditText) findViewById(R.id.editTextNew);
            Intent intent = new Intent(NewTextActivity.this, SendActivity.class);
            intent.putExtra("location", etLocation.getText().toString());
            startActivity(intent);
        };
        }

This is the listvew : 这是listvew

final OnFriendsListener mOnFriendsListener = new OnFriendsListener() {

@Override
        public void onComplete(List<Profile> friends) {

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mSpinner.setVisibility(View.GONE);
                    mSpinner.clearAnimation();
                }
                });

            // populate list
            List<String> values = new ArrayList<String>();
            for (Profile profile : friends) {
                //profile.getInstalled();
                values.add(profile.getName());
            }

My next goal is to be able to make this text be sent to a friend within this listview , and then be recieved by that friend inside the app, and not on the actual facebook chat, but i can't really find any examples or instructions on how to do this with the facebook sdk, any tips on how i could go from here or links i could check out? 我的下一个目标是能够将此文本发送给此listview的朋友,然后由应用程序内的该朋友收到,而不是实际的Facebook聊天,但我无法找到任何示例或说明关于如何使用facebook sdk执行此操作,有关如何从此处或我可以查看的链接的任何提示? :) :)

You would have to keep a track of users in your own DB using their unique facebook ids. 您必须使用他们独特的facebook ID跟踪您自己的数据库中的用户。 Then you would incorporate your own "chat" protocol, Such as XMPP, check this out for further reading: Android and XMPP . 然后,您将合并自己的“聊天”协议,如XMPP,请查看以供进一步阅读: Android和XMPP

You can't just send a message using the facebook SDK is what I'm trying to say ;) 您不能只使用facebook SDK发送消息是我想说的;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM