即時遊戲 本機端測試需要二個東西
1.透過
npm
安裝 http-server
套件npm install -g http-server
2.SSL
下載openSSL
https://slproweb.com/products/Win32OpenSSL.html
我的是win7所以下載檔案
Win64 OpenSSL v1.1.0k
安裝完會在C:\OpenSSL-Win64\bin
openssl.exe
接下來在
cd path/to/my/game/
openssl genrsa 2048 > key.pem
openssl req -x509 -days 1000 -new -key key.pem -out cert.pem
http-server --ssl -c-1 -p 8080 -a 127.0.0.1
https://www.facebook.com/embed/instantgames/YOUR_GAME_ID/player?game_url=https://localhost:8080/index.html
FBInstant.getLocale()
//zh_TW
getLocale
getPlatform
getSDKVersion
getSupportedAPIs
getEntryPointData
player.getID
player.getName
player.getPhoto
context.getID
context.getType
context.isSizeBetween
logEvent
onPause
inventory.unlockItemAsync
matchPlayerAsync
initializeAsync
setLoadingProgress
setSessionData
startGameAsync
player.flushDataAsync
player.getDataAsync
player.setDataAsync
player.subscribeBotAsync
player.getConnectedPlayersAsync
player.getSignedPlayerInfoAsync
context.switchAsync
context.chooseAsync
context.createAsync
context.getPlayersAsync
shareAsync
switchGameAsync
quit
getEntryPointAsync
getLeaderboardAsync
checkCanPlayerMatchAsync
context.isPublicAsync
player.canSubscribeBotAsync
player.getStatsAsync
player.setStatsAsync
player.incrementStatsAsync
postSessionScore
referrals.getCountAsync
updateAsync