Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 850 Bytes

readme.md

File metadata and controls

51 lines (43 loc) · 850 Bytes

FBApi

Demo: https://zxccxz0119.github.io/example/fbapi.html

Getting Started

<script src="https://zxccxz0119.github.io/assets/fbapi.js"></script>

Usage

<button onClick="login()">login & get info</button> 
<button onClick="fbapi.share('https://www.w3schools.com/')">share</button>
var fbapi = new FBApi({
  appId: 'your_appid',
  version: '', // default is 'v6.0'
})

function login(){
  fbapi.login().then(()=>{
      return fbapi.getProfile()
  }).then((res) => {
      console.log(res)
  })
}

feature

checkStatus

fbapi.checkStatus()

login

fbapi.login()

getProfile

fbapi.getProfile()

share

alertOpen is boolean, default is true.

fbapi.share(link,alertOpen)