How to invite a users friends to an event? Facebook Graph API

后端 未结 5 1896
故里飘歌
故里飘歌 2020-12-16 03:35

I have an application using the Graph API. I have it creating events for the user, but would like to let the user invite their friends from our site instead of having to go

5条回答
  •  一整个雨季
    2020-12-16 04:01

    I actually was able to get an answer from the Facebook team and they just told me to use the old API through the new PHP interface. They have yet to convert this functionality and don't know if it will be converted.

    Edit:

    Here is the code I used to invite friends after I got the IDs from the new api ($id_array). This is applied in a wrapper around the PHP Facebook object I used to hold all my Facebook specific code.

        $fb = new FacebookGraph(array(
            'appId' => 'xxxx',
            'secret' => 'xxxx',
            'cookie' => true,
        ));
        $fb->api(array(
            'method' => 'events.invite',
            'eid' => $event_id,
            'uids' => $id_array,
            'personal_message' => $message,
        ));
    

提交回复
热议问题