Facebook live stream only when I'm online
I would like to show a facebook livestre开发者_JS百科am box, but only when I'm online. Is there a way to check if I'm online? Maybe with php?
I found some suggestions but they seem to be old....
For your account, get an access token with the user_online_presence
and offline_access
permissions. Then you can run the following FQL query with that access token:
SELECT online_presence from user where uid=me()
Then just only render the livestream plugin on your page if online_presence is 'active' or maybe also 'idle'.
<div class="fb-live-stream"
data-event-app-id="321046074604304"
data-width="200"
data-height="300"
data-xid="38b9005e85114dc9f71b6781f1d20a12"
data-via-url="http://viadewakoplax.blogspot.com/"
data-always-post-to-friends="true"></div>
精彩评论