@genvidtech/cordova-plugin-marketplace
v1.1.2
Published
Cordova Marketplace Plugin
Readme
Cordova Marketplace Plugin
Reports how the app was installed / which app marketplace it came from. Exposes
window.plugins.marketplace with a single action, getInfo.
Installation
cordova plugin add @genvidtech/cordova-plugin-marketplaceThe plugin is published publicly to npm under the
@genvidtech
scope.
Development
File structures
plugin.xml: The plugin configuration filesrc/android/: Android source codeios/: iOS source code
www/: Web source codetests/: Node Project Plugin Teststypes/: Some type definitions (manually update)demo/: Node Demo project also use for testing
How to build the plugin
npm i
npm run lint
npm run packageThis will create two packages:
genvidtech-cordova-plugin-marketplace-<version>.tgzfor the plugincordova-plugin-marketplace-tests-<version>.tgzfor the tests
Notice
Please, maintain the .npmignore consistently to avoid
distributing unnecessary files in the packages.
Releasing
Releases are published to npm automatically by GitHub Actions using OIDC
trusted publishing — no npm token is stored anywhere. Pushing a vX.Y.Z tag
that matches package.json's version triggers
.github/workflows/publish.yml, which runs the
shared validation gate and then npm publish --provenance. ci.yml runs the
same gate (lint / typecheck / test / build) on every pull request and push to
main.
Continuous integration
Native builds run on GitHub Actions (CircleCI has been removed):
android.ymlandios.ymleach run a smoke build on every pull request and push tomain— Android compiles/links onubuntu-latest, iOS builds for the simulator onmacos-15. These require no secrets.- On a
vX.Y.Ztag or a manual Run workflow (workflow_dispatch), a distribute job builds a signed artifact for sideloading. Android produces a signed.apk. The iOS distribute job is wired up but currently disabled pending a signing identity (a.p12that includes the certificate's private key) — see the note at the top of that job inios.yml.
Signing material is pulled from 1Password at run time via a single repository
secret, OP_SERVICE_ACCOUNT_TOKEN (a service account scoped to the signing
vault); no certificates or keystores are stored in GitHub.
How to build and run the test demo
After having built the packages:
npm run setup:demo
npm run setup:demo:<platform> # adds the cordova platform (android | ios)
npm run build:demo:<platform> # device build (iOS uses --device)where <platform> is replaced with either android or ios. The Android SDK
(and, for iOS, Xcode) must already be installed on your machine.
Then you can run the application on a connected device/emulator:
npm run run:<platform>To build for the iOS simulator (no signing required — this is what CI's smoke
job runs), use the :sim scripts instead:
npm run setup:demo:sim
npm run setup:demo:sim:ios
npm run build:demo:ios:simTo clean everything and rebuild, you can do:
npm run refresh:<platform>Manual installation and running for Android
Sometimes, cordova doesn't select the right ABI to upload. You will get an error like:
Using apk: C:\repos\cordova-plugin-eos\demo\platforms\android\app\build\outputs\apk\debug\app-armeabi-v7a-debug.apk
Package name: com.genvidtech.eosdemo
Command failed with exit code 1: adb -s 38110DLJH000N8 install -r C:\repos\cordova-plugin-eos\demo\platforms\android\app\build\outputs\apk\debug\app-armeabi-v7a-debug.apk
adb: failed to install C:\repos\cordova-plugin-eos\demo\platforms\android\app\build\outputs\apk\debug\app-armeabi-v7a-debug.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]Here what to do:
# install the right APK
abd install -r .\demo\platforms\android\build\outputs\apk\debug\app-{abi of your android device}-debug.apk
# start the application on the device
adb shell am start -n com.genvidtech.eosdemo/com.genvidtech.eosdemo.MainActivity
# output logs
adb logcat --pid=$(adb shell pidof -s com.genvidtech.eosdemo) | tee eosdemo.log