fliplet-native scope review
Purpose: plan the consolidated documentation for fliplet-native before
authoring. Reviewer signs off on (a) the per-sub-module recommendations and
(b) the file-grouping shape; then authoring proceeds.
Summary
- Total sub-modules surveyed: 13
- “Document fully” recommendations: 9
- “Keep but skip docs” recommendations: 2
- “Delete from source” recommendations: 0
- 4 already excluded per V3-relevance call (AppData / Authentication / Config / Templates)
- Top-level bootstrap (
native.js) documented as “Native (top)” entry point section
Per-sub-module review
1. Native (top-level bootstrap)
Source signal
- File:
native.js— 7.6 KB - Last git-touched: 2026-04-13
- Classification: active
Public surface
- Namespace:
Fliplet.Native(root object; no sub-namespace) - Public methods:
Fliplet.Native.init()— orchestrates the full native boot sequence (storage restore → AppManagement → Maintenance → Downloads → Locale → Updates → Interaction); called automatically viaFliplet.Navigator.onPluginsReady()Fliplet.Native.getFrameworkVersion()— reads the bundledframework-data.jsonand caches the version string inFliplet.Storage
- Platform conditionals: Android-specific resize listener injected at boot; boot sequence skipped on non-native (guard via
window.ENV.platform === 'native')
V3-relevance: yes — native.js is the V3-native bootstrap entry point; the V3 guard (window.ENV.engine === 'v3') is explicit in the source
Recommendation: document fully — explain that Fliplet.Native.init() is called automatically and that getFrameworkVersion() is the only method app code would ever call directly
Estimated doc length: ~30 lines
2. AppManagement (app-management.js)
Source signal
- File:
app-management.js— 16.7 KB - Last git-touched: 2026-05-13
- Classification: active
Public surface
- Namespace:
Fliplet.Native.AppManagement - Public methods (17, 1 deprecated):
init()— initialises the PV-backed local apps storegetLocalApps()— resolves with the device-stored app listgetLocalAppsSync()— synchronous variant; returns array directlysetLocalApps(apps)— persists a new app array to PV storagegetServerApps()— fetches the authorized app list fromv1/appsgetFullApps()— merges server and local lists, annotating each withlocalanddeleteflagsaddLocalApp(app)— upserts an app entry into local storageremoveLocalApp(app)— cancels downloads, deletes files, and removes the app from local storagegetAppData(appId)— synchronous lookup of a locally stored app by IDsetAppFullData(appData)— fetches full bundle data for an app and updates local storageremoveAppAssets(options)— removes specific asset paths from a locally stored app recordgetAppIcon(app)— resolves the local filesystem icon path for an appdoesAppIconExist(app, fileList)— helper that checks directory entries for an icon fileremoveAppStorage(appId)— clears all Fliplet.Storage namespaces tied to an app IDrefreshAppList()— deprecated (FV 1.0 era); stubs remain in sourceremoveLocalAppData(appId)— deprecated; mutates in-memory array without persistence
- Platform conditionals:
getAppIconskips on Windows (Modernizr.windows); directory API is Cordova-only
V3-relevance: yes — actively maintained; called during V3 native boot
Recommendation: document fully — surface the methods that component authors or maintenance scripts legitimately call (getLocalApps, getLocalAppsSync, removeLocalApp, removeAppStorage, getAppData); mark deprecated pair as deprecated
Estimated doc length: ~70 lines
3. Interaction (app-interaction.js)
Source signal
- File:
app-interaction.js— 5.9 KB - Last git-touched: 2022-03-24
- Classification: dormant (4+ years)
Public surface
- Namespace:
Fliplet.Native.Interaction(the file setsFliplet.Native.Interaction, not.AppInteraction) - Public methods (2):
init(portalSpecific)— attaches pointer/touch listeners that detect a long-press (500 ms tap-and-hold), then shows a nativeconfirmdialog offering “Check for updates”, “Exit”, or “Cancel”; called bynative.jsonly whenFliplet.App.isPreview(true)returnToBookshelf()— programmatically triggers the same exit dialog
- Platform conditionals: no explicit iOS/Android conditional; relies on
Fliplet.Navigate.exitApp()which is native-only
V3-relevance: yes — the long-press-to-exit gesture is still shipped in preview builds; native.js calls Interaction.init(true) in the boot sequence
Recommendation: document fully — the dormancy reflects stable, not dead, code; the public surface is small but the behavior (long-press escape hatch) is non-obvious and worth documenting for developers who want to disable or extend it
Estimated doc length: ~25 lines
4. Updates (app-updates.js)
Source signal
- File:
app-updates.js— 35.5 KB - Last git-touched: 2026-04-13
- Classification: active
Public surface
- Namespace:
Fliplet.Native.Updates - Public methods (3):
init()— reads last-update timestamp from storage, resumes any in-progress download UI, then either fires an immediate update check (first run or notification-triggered) or sets a 30-second polling timercheckForUpdates(appId, manual, lastUpdateType, notificationData, force)— queriesv1/apps/:id/bundle/update, coordinates the update UI (silent / visible / forced overlays), manages incremental DataSource diffs, delegates file queuing toDownloads, and handles notification deep-link navigationcreateUpdateTimer()— re-arms the 30-second background update timer
- Platform conditionals: uses
cordova.plugins.insomniato prevent screen sleep during downloads (graceful fallback if plugin absent)
V3-relevance: yes — actively maintained; integral to the V3 native OTA update pipeline
Recommendation: document fully — checkForUpdates is the one method developers call directly (e.g. from a “Check for updates” button); the init and timer methods are framework-internal but should be noted
Estimated doc length: ~50 lines
5. Downloads (downloads.js)
Source signal
- File:
downloads.js— 54.5 KB - Last git-touched: 2025-10-24
- Classification: active
Public surface
- Namespace:
Fliplet.Native.Downloads - Public methods (13):
init()— resolves Cordova filesystem paths (differs iOS vs Android), restores PV-backed download queue, resumes any in-progress downloadsstartDownloads(appId, hasIncrementalUpdates)— processes the queued asset list for an app, dispatching up to 8 concurrent file transfers (5 on Android)addAppDownload(app, hasIncrementalUpdates)— adds an app’s asset manifest to the download queue PVcancelAppDownloads(appId)— aborts all active transfers for an app and clears its queue entrygetAppDownloads(appId)— resolves if an app has active downloads, rejects otherwisegetAllAppsDownloads()— returns the full downloads PV array synchronouslysetAppsDownloads(apps)— overwrites the downloads PV (internal use)getTempDownloadPath()— returns the filesystem temp directory path stringdownloadFile(options)— low-level single-file transfer via CordovaFileTransfergetFile(options)— reads a file from the app’s local foldergetNrOfDownloads(appId)— returns count of assets queued for an appgetPercentageDownload(appId)/getPercentageDownloadAsync(appId)— sync and async variants of download-progress percentagedownloadCoverImages(options)— downloads app cover/icon images with a progress callbackgetErrorMessage(appId)/getAppErrorSummary(appId)— retrieves the stored download-error summary for an app
- Platform conditionals: Android uses
externalDataDirectoryandapplicationStorageDirectory; iOS usesdataDirectory; concurrent-download cap lowered to 5 on Android
V3-relevance: yes — the primary asset-delivery engine for V3 native OTA updates
Recommendation: document fully — large surface; cancelAppDownloads, getPercentageDownloadAsync, and getAppErrorSummary are the methods most likely called by app code; the rest are internal coordination
Estimated doc length: ~80 lines
6. Locale (locale.js)
Source signal
- File:
locale.js— 3.3 KB - Last git-touched: 2022-08-23
- Classification: dormant (3.5+ years)
Public surface
- Namespace:
Fliplet.Native.Locale - Public methods (2):
init(appId)— reads<appId>/strings.jsonfrom the Cordova filesystem, loads locale metadata (_locales), setsFliplet.Env('translation'), and callsFliplet.initializeLocale()updateSessionLocale(appId, locale)— rewrites the_localesarray instrings.jsonon disk so the chosen locale is promoted to index 0
- Platform conditionals: depends on
Fliplet.Native.Maintenance.readFileContentand.writeFile(Cordova filesystem); not callable on web
V3-relevance: yes — native.js calls Locale.init(currentAppId) in the V3 boot sequence; strings.json is delivered via the OTA update pipeline
Recommendation: document fully — dormancy reflects that the strings format is stable, not that the module is unused; updateSessionLocale is the only method a component might call to switch the active locale at runtime
Estimated doc length: ~25 lines
7. Maintenance (maintenance.js)
Source signal
- File:
maintenance.js— 45.9 KB - Last git-touched: 2026-02-19
- Classification: active
Public surface
- Namespace:
Fliplet.Native.Maintenance - Public methods (22, 2 deprecated):
init()— full bootstrap: sets up file paths, reads preloaded app list, navigates to the default page; used by the maintenance HTML pageinitWithParams()— lightweight init that only sets up file paths; called bynative.jsduring normal bootgetPreloadedAppList()— readsdefault.jsfrom the preloaded bundle to get initial app configurationcreateDirectoryForApp(appId)— creates a per-app directory in the Fliplet data folderdeleteFiles(options)— removes a list of app directories from the filesystemdeleteListOfFiles(options)— removes individual asset files by pathlaunchStartPage(app)— navigates to an app’s start pagestartBundleCopyProcess(options)— orchestrates copying of preloaded bundle files to the data directorycopyFileListIntoDirectory(options)— bulk-copies an array of file entries to a destinationcopyFile(options)— copies or moves a single file entrycopyFileBasedOnFullPaths(src, dest)— copies a file by resolving two native URL pathsreadDirectoryFiles(dir)— reads and resolves with the entries of a directorycheckIfFileExists(path)— resolves if the file exists at a relative path under the data foldercheckValidFileFullPath(path)— resolves a full native URL path if validgetApplicationMode()— returns'internal'or'external'(affects legacy bundle URL)nativeOpenFile(path)— opens a file using the device’s native file-opening intentgetFileMetaData(path)— returns file metadata (size, lastModified) for a given pathreadFileContent(filePath)— reads and resolves with the text content of a filewriteFile(relativePath, content, options)— serializes and writes content to a file in the app folderunzipFilesIntoDirectory(options)— unzips a downloaded bundle into the data foldergetAppConfigurationFile(appId)— reads and parses the JSON config file for an appsaveAppDataJSON()— persists the current app list to a JSON filegetFlipletDataFolder()/getFlipletWWWFolder()/getFlipletTempFolder()— return platform-specific folder path stringsgetDefaultAppID()— readsfl_default_app_idfrom NativeStorageloadBundledFiles()— deprecatedcheckIfEnoughFreeSpace()— deprecated and incomplete (TODO comment; always returns true)
- Platform conditionals: Windows (
Modernizr.windows) skips the full init; Android vs iOS path divergence fordataDirectory/applicationStorageDirectory
V3-relevance: yes — the filesystem abstraction layer consumed by every other active sub-module
Recommendation: document fully — this is the most complex sub-module; the dozen path-manipulation and file-read/write methods are legitimately callable by custom components (e.g. readFileContent, nativeOpenFile, getFileMetaData); the maintenance-page init flow needs its own callout
Estimated doc length: ~100 lines
8. Notifications (notifications.js)
Source signal
- File:
notifications.js— 4.8 KB - Last git-touched: 2026-03-13
- Classification: active
Public surface
- Namespace:
Fliplet.Native.Notifications - Public methods (2):
init()— bindscordova.plugins.notification.localclick handler and checksfl_pending_notificationstorage for a deferred notification payload (from an org-switch reload cycle)handle(data, delay)— processes a raw notification payload: runspushNotificationOpenhook, optionally switches organization, and navigates to the target screen or triggers acheckForUpdatescall if the screen is not yet loaded
- Platform conditionals: silently no-ops if
cordova.plugins.notificationis undefined (web/simulator)
V3-relevance: yes — the sole handler for local-notification deep-links in V3 native apps
Recommendation: document fully — handle() is worth documenting as it can be called directly by components that generate programmatic notifications
Estimated doc length: ~30 lines
9. StatusBar (status-bar.js)
Source signal
- File:
status-bar.js— 4.3 KB - Last git-touched: 2026-06-01
- Classification: active (just updated)
Public surface
- Namespace:
Fliplet.Native.StatusBar - Public methods / properties (5 + 1 init):
init()— iOS-only; ensures bar is visible, callsStatusBar.overlaysWebView(false)to push content below the bar, and sets color based on page background brightness viaFliplet.Page.getStatusBarBgColor()setColor(color)— accepts'light'or'dark'/'default'; callsStatusBar.styleLightContent()orStatusBar.styleDefault()show()— shows the native status barhide()— hides the native status barisVisible()— returnsStatusBar.isVisibleboolean-
notch— exposed string property ('''left''right'); updated on orientation change viacheckNotch()
- Platform conditionals:
init()is iOS-only (Modernizr.ios);setColor/show/hide/isVisibleguard ontypeof StatusBar === 'undefined'and log errors on web; notch detection works on any orientation-API-supporting browser
V3-relevance: yes — newly active (2026-06-01 touch); show(), hide(), setColor() are reasonable to call from screen code
Recommendation: document fully — show, hide, setColor, and isVisible are the four methods developers might legitimately call; notch property is useful for layout compensation
Estimated doc length: ~35 lines
10. AppData / Data (app-data.js) — EXCLUDED
Source signal
- File:
app-data.js— 2.2 KB - Last git-touched: 2022-03-24
- Classification: dormant
Public surface
- Namespace:
Fliplet.Native.Data - Methods:
init(),saveData(trackingData),sendStoredData(),sendData(options) - Functionality: a PV-backed queue that batches and retries POST requests to
v1/widget-instances/:id/data-tracking
V3-relevance: no — dormant telemetry queue; the tracking endpoint is internal widget infrastructure; no V3 component should call this directly; superseded by server-side analytics pipelines
Recommendation: keep but skip docs — still called by native.js (Fliplet.Native.Data.init()), so not dead code, but the API surface is internal-only; no end-user documentation warranted
Estimated doc length: 0 lines
11. Authentication (authentication.js) — EXCLUDED
Source signal
- File:
authentication.js— 5.9 KB - Last git-touched: 2022-03-24
- Classification: dormant
Public surface
- Namespace:
Fliplet.Native.Authentication - Methods:
loginUser,logoutUser,verifyLogin,getAuthToken,setAuthToken,saveUserDetails,getUserDetails,clearUserDetails - Relies directly on
NativeStorage(Cordova plugin) for all persistence
V3-relevance: no — superseded by Fliplet.User (which abstracts storage); all NativeStorage calls are legacy; V3 apps use Fliplet.Session / Fliplet.User for auth
Recommendation: keep but skip docs — native.js does not call this module in its boot sequence; referenced only by legacy portals; code is not reachable from modern app code, but removal requires native team sign-off
Estimated doc length: 0 lines
12. Config (config.js) — EXCLUDED
Source signal
- File:
config.js— 2.0 KB - Last git-touched: 2022-03-24
- Classification: dormant
Public surface
- Namespace:
Fliplet.Native.Config - Methods:
setApplicationSchema(options),getApplicationSchema() - Stores two keys (
current_webservice_url_v2,current_application_schema_v2) via NativeStorage
V3-relevance: no — stores the API endpoint schema for the legacy FV 1.0 environment switcher; V3 apps resolve their API URL from window.ENV; no call site in the V3 native boot sequence
Recommendation: keep but skip docs — used only by the legacy Fliplet Viewer environment switcher; no app-level documentation warranted
Estimated doc length: 0 lines
13. Templates (templates.js) — EXCLUDED
Source signal
- File:
templates.js— 3.3 KB - Last git-touched: 2021-12-09
- Classification: dormant (oldest file in the package)
Public surface
- Namespace:
Fliplet.Native.Templates - Properties:
Fliplet.Native.Templates.Update— a single HTML string containing the update-overlay markup and four<script type="text/html">template blocks (default, success, already-updated, fail states)
V3-relevance: no — the template markup is consumed internally by app-updates.js via $('body').append(Fliplet.Native.Templates.Update); no external API; developers do not interact with this namespace
Recommendation: keep but skip docs — strictly an internal rendering dependency of Updates; required at runtime but not a public API
Estimated doc length: 0 lines
File grouping recommendation
Recommendation: (b) hybrid — one main doc + 2 separate files for the two largest sub-modules
Rationale:
- Downloads (54.5 KB source, ~80 doc lines) and Maintenance (45.9 KB source, ~100 doc lines) each have surfaces substantial enough that burying them as H2 sections in a consolidated file would make the page unwieldy (~400+ lines total) and difficult to deep-link.
- Updates (35.5 KB source, ~50 doc lines) and AppManagement (16.7 KB source, ~70 doc lines) are mid-sized but their content is closely tied to the top-level Native and boot-sequence narrative; keeping them inline avoids the need for cross-links on the most common reader path (understanding the boot flow).
- The four small modules (Interaction, Locale, Notifications, StatusBar, ~25–35 lines each) are most useful as H2 sections — readers land there because they saw
Fliplet.Native.StatusBarin someone else’s code and want a quick reference.
Proposed output:
| File | Contents |
|---|---|
docs/API/fliplet-native.md |
Package overview, install note, feature-detect callout, H2 sections for: Native (top), AppManagement, Updates, Interaction, Locale, Notifications, StatusBar |
docs/API/fliplet-native/downloads.md |
Full Fliplet.Native.Downloads reference (linked from main doc) |
docs/API/fliplet-native/maintenance.md |
Full Fliplet.Native.Maintenance reference (linked from main doc) |
All three files carry the standard fliplet-native frontmatter tag and a prominent callout:
Native wrapper only. All APIs on this page are only available inside a Fliplet native app. Feature-detect with
Fliplet.Env.get('platform') === 'native'before calling any method.
Approval
For each row, the reviewer marks [approve] or [modify: ...].
| # | Sub-module | Namespace | V3-relevant? | Recommendation | Reviewer |
|---|---|---|---|---|---|
| 1 | Native (top) | Fliplet.Native |
yes | document fully | [approve] |
| 2 | AppManagement | Fliplet.Native.AppManagement |
yes | document fully | [approve] |
| 3 | Interaction | Fliplet.Native.Interaction |
yes | document fully | [approve] |
| 4 | Updates | Fliplet.Native.Updates |
yes | document fully | [approve] |
| 5 | Downloads | Fliplet.Native.Downloads |
yes | document fully | [approve] |
| 6 | Locale | Fliplet.Native.Locale |
yes | document fully | [approve] |
| 7 | Maintenance | Fliplet.Native.Maintenance |
yes | document fully | [approve] |
| 8 | Notifications | Fliplet.Native.Notifications |
yes | document fully | [approve] |
| 9 | StatusBar | Fliplet.Native.StatusBar |
yes | document fully | [approve] |
| 10 | AppData / Data | Fliplet.Native.Data |
no | keep but skip docs | [approve] |
| 11 | Authentication | Fliplet.Native.Authentication |
no | keep but skip docs | [approve] |
| 12 | Config | Fliplet.Native.Config |
no | keep but skip docs (legacy FV only) | [approve] |
| 13 | Templates | Fliplet.Native.Templates |
no | keep but skip docs (internal rendering) | [approve] |
| — | File grouping | hybrid (b): main + downloads.md + maintenance.md | — | — | [approve] |