fb

fb.fb.token_update

Declaration
lua
fb.token_update(uid, token [, type [, page_id]])
Description
Lấy token Page và lưu cache. UID/Page ID là chuỗi chữ số; type chỉ ios hoặc bus. Khi phân trang hoặc ghi DB thất bại, trả số Page đã lưu kèm lỗi.
Parameters
uid (string): UID tài khoản, dùng làm tên DB. token (string): user access token. type (string, tùy chọn): ios (mặc định) hoặc bus. page_id (string, tùy chọn): chỉ cập nhật một Page.
Return Values
count[,error]; tham số sai: nil,error. Phải kiểm tra error kể cả khi count khác nil.
Example
lua
local uid, token = fb.getcookie()
local count, err = fb.token_update(uid, token, "ios")
if err then sys.log(err) else sys.log("Updated " .. count .. " Page tokens") end
Notes
Graph API v25.0. Retry hữu hạn, loại Page trùng, chặn URL phân trang lặp hoặc ngoài graph.facebook.com. Chỉ cập nhật token_ios hoặc token_bus đã chọn. Token đầu vào là user access token; hàm lấy token Page và không tạo token đăng nhập của app.