--- title: Line Beacon 規範 tags: line --- # Line Beacon 規範 ### 需求紀錄 - 一台藍牙機(目前使用 Raspberry pi 4),新版 MAC 無法當作藍牙機 - node.js version 需為8.3.11 ## 功能紀錄 目前主要分成beacon event type 分為 `enter`、`banner`、`stay` 會透過 beacon 發送 event object 至 linebot 的 webhook,進行相對應的通知 ```javascript= bot.on('beacon', async (event) => { console.log("beacon", event); event.reply(JSON.stringify(event)); }); // { // "destination": "xxxxxxxxxx", // "events": [ // { // "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", // "type": "beacon", // "mode": "active", // "timestamp": 1462629479859, // "source": { // "type": "user", // "userId": "U4af4980629..." // }, // "beacon": { // "hwid": "d41d8cd98f", // "type": "enter" // } // } // ] // } ``` ### 問題紀錄 - beacon event,並非非常穩定,並不是你一進入藍牙範圍就會馬上推播訊息(無法確定是否為設備非 line 官方 裝置問題) - beacon banner,需要有官方 Business 才可使用(未測試過樣式) --- 相關資源: - 官方範例:https://github.com/line/line-simple-beacon
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up