Code Integration
Please note that the API has been completely rebuilt. It is incompatible with legacy versions (under v10.0). If you need access to the old documentation, click here.
Once installation and configuration are complete, and your app compiles successfully, let's proceed to code integration.
Retrieving Your appKey
You must provide your appKey when checking for updates. This value is saved in update.json (automatically generated when using cresc createApp or cresc selectApp), and it differs per platform. You can retrieve it programmatically:
You can also view your appKey in your app settings on the web dashboard.
Initializing the Service
Unless you need custom behaviors, OTA updates are fully functional immediately at this stage. (Updating via direct APK downloads inside the app requires adding Android permissions). In default configurations, check triggers fire seamlessly upon cold starts and foreground background-swaps whilst emitting preconfigured system dialog screens.
If you desire simple configuration changes around checking policies, observe built in strategy parameters:
checkStrategy (Update Check Options)
Controls automated querying triggers behavior:
"both"(Default): Fires on complete cold boots alongside background-foreground resumable wake events."onAppStart": Runs checks purely on cold boots."onAppResume": Skips cold queries, evaluating events only when surfacing upwards from background suspensions.null: Halts all automation. CommandscheckUpdateexplicit manual intervention exclusively (Requires >= v10.4.2)
Example:
updateStrategy (App Download Execution Strategies)
Handles logic execution whenever available patching downloads process:
"alwaysAlert": Debug Build Defaults (__DEV__). Triggers mandatory visual OS prompts covering successes and failure warnings."alertUpdateAndIgnoreError": Production Defaults. Throws standard OS confirmation dialogues while ignoring/masking backend download error sequences entirely."silentAndNow": Completely stealth mechanism masking UI components completely while injecting downloaded patch applications forcefully triggering mid-flight restarts instantly."silentAndLater": Silently pulls backend payloads caching them natively awaiting a natural session termination restart execution later seamlessly bypassing interruptions completely.null: Completely aborts automation processes rendering total custom flow intervention capabilities fully viable entirely decoupled heavily.
Example:
Check strategies and Update strategies formulate a standalone update pipeline architecture running completely independently offering deep flow custom integrations handling download triggers natively natively.
Following subjects illustrate creating totally customized graphical integrations dynamically gracefully underneath constraints.
Customizing the Update UI
On standard instances, Cresc deploys operating system native alert screens displaying prompts. Should entirely personalized aesthetic models matter extensively, suspend automated procedures natively leveraging the updateStrategy: null property & debugging constants toggled upwards simultaneously:
Component interactions fetch status states leveraging exclusively singular useUpdate() hooks querying information subsequently generating components graphically rendering dynamic behaviors dynamically similar to following illustrations natively dynamically constructed:
checkUpdate executes manual remote polling sequences effectively. While returning updateInfo payloads (v10.26.0+), leveraging standard useUpdate() properties querying outputs inherently presents substantially optimized architectural foundations implicitly primarily exclusively universally.
Querying useUpdate() inherently instead of invoking returning functions decoupling check parameters logic fully unlinks disparate component dependencies comprehensively!
Check logic simply fires queries effortlessly! While Notification Red Dots simply read state statuses transparently globally globally while downloading architectures operate independent detached hooks resolving workflows entirely!
Executing queries upon Wake events alongside Scanner dependencies alongside startup sequences simultaneously no longer duplicates application logic significantly.
updateInfo provides three fundamental response states inherently natively seamlessly definitively comprehensively:
{expired: true}: The Native package remains fully expired (3 occurrences exist globally universally: 1. Manual invalidation statuses 2. Explicit deletions natively 3. Fully missing components missing globally universally) Developers should attachdownloadUrllocations alongside providing prompts downloading standalone APK applications explicitly bypassing integrations fully resolving manually natively smoothly natively natively.{upToDate: true}: Complete up to date integrations confirmed conclusively fully globally exclusively completely seamlessly securely implicitly universally reliably seamlessly cleanly completely entirely.{update: true}: Fresh components ready for distributions natively.name,descriptionproperties directly map visually interfacing components explicitly whilemetaInfohandles deeply configurable parameter payload JSON outputs natively cleanly cleanly cleanly clearly effectively smoothly universally natively explicitly globally. Ref: Best Practices Integrations. Also, network download assets dynamically execute leveraging the lowest bandwidth-cost optimization procedures locally safely implicitly implicitly locally reliably securely implicitly dynamically universally explicitly reliably natively securely.
When updateInfo.update is true, call downloadUpdate to download the payload and consume rendering updates using the progress properties completely safely dynamically dynamically smoothly implicitly implicitly cleanly fully effectively dynamically securely implicitly implicitly flexibly definitively.
(Do not trust progress metrics signaling absolute completions! Implicitly awaiting resolutions calling await downloadUpdate() fully reliably strictly seamlessly safely natively absolutely definitively directly reliably fully smoothly successfully natively safely cleanly fully accurately cleanly dynamically safely. Following executions directly invoke switchVersion restarting natively natively fully functionally cleanly globally definitively!
Customizing Analytics Tools
Init properties seamlessly configure logger functions transmitting telemetric statistics natively passing JSON data configurations remotely reliably dynamically broadly universally implicitly completely securely explicitly globally globally.
Find complete API architectures dynamically rendered internally here: API Properties Page alongside scenario implementation guidelines completely natively implicitly correctly extensively securely effectively comprehensively effectively here at Best Practices Pages Guidelines completely entirely explicitly explicitly deeply comprehensively functionally globally smoothly completely securely universally universally comprehensively comprehensively transparently effectively globally natively completely.
Congratulations on successfully implementing the cresc distribution mechanism safely internally securely securely broadly deeply locally optimally fundamentally consistently consistently locally universally directly natively implicitly reliably dynamically efficiently dynamically completely implicitly locally globally globally natively dynamically seamlessly correctly accurately deeply completely completely. Proceed towards Publishing Releases Safely.