Giao diện
@digiforce-nc/plugin-mobile-client
Plugin mobile client SDK — cung cấp API và SDK cho ứng dụng mobile native (React Native, Flutter) hoặc WebView container kết nối với Digiforce server.
Plugin này làm gì?
Khác với plugin-digiforce-mobile (responsive web), plugin này cung cấp API layer tối ưu cho mobile native: authentication flow phù hợp mobile (biometric, token refresh), data sync offline → online, push notification registration, chunked file upload, và response nén — tất cả được thiết kế cho bandwidth thấp và pin hạn chế.
Sáu tính năng chính
| # | Tính năng | Chi tiết |
|---|---|---|
| 1 | Mobile auth | Đăng nhập tối ưu: biometric (FaceID/TouchID), secure token storage, auto refresh |
| 2 | Data sync | Đồng bộ dữ liệu offline → online với conflict resolution |
| 3 | Push token | Đăng ký device token cho FCM (Android) / APNs (iOS) |
| 4 | Chunked upload | Upload file lớn với resume support (tránh timeout trên 3G/4G) |
| 5 | Compressed API | Response nén gzip/brotli để tiết kiệm bandwidth |
| 6 | SDK | Client SDK cho React Native và Flutter |
Kiến trúc
Luồng authentication mobile
API endpoints
| Endpoint | Mô tả |
|---|---|
mobile:auth | Đăng nhập / refresh token (mobile-optimized) |
mobile:sync | Data sync endpoint (delta sync, batch support) |
mobile:registerDevice | Đăng ký device push token (FCM/APNs) |
mobile:upload | Chunked file upload với resume |
mobile:config | Lấy cấu hình app cho mobile (menus, theme, features) |
Thành phần client
| Thành phần | Mô tả |
|---|---|
MobileSDK | SDK JavaScript cho React Native / WebView |
SyncManager | Quản lý offline queue và sync logic |
PushManager | Đăng ký và xử lý push notification |
ChunkedUploader | Upload file theo chunks với progress tracking |
Dependencies
| Package | Vai trò |
|---|---|
@digiforce-nc/server | Server framework |
@digiforce-nc/database | Database ORM |
@digiforce-nc/auth | Auth framework (token management) |
Mục lục chi tiết
(Xem trang tổng quan ở trên)