{"id":31952828,"url":"https://github.com/batchlabs/batch-cordova-plugin","last_synced_at":"2025-10-14T13:25:10.059Z","repository":{"id":53438622,"uuid":"43156857","full_name":"BatchLabs/Batch-Cordova-Plugin","owner":"BatchLabs","description":"Batch SDK Cordova/Ionic plugin for Android and iOS","archived":false,"fork":false,"pushed_at":"2025-09-23T08:33:15.000Z","size":60813,"stargazers_count":9,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-29T23:55:35.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://doc.batch.com/cordova/sdk-integration","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BatchLabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-09-25T15:46:14.000Z","updated_at":"2025-09-19T11:54:26.000Z","dependencies_parsed_at":"2024-09-05T15:03:07.824Z","dependency_job_id":"5f85c1d9-103f-439f-976e-546a706c2374","html_url":"https://github.com/BatchLabs/Batch-Cordova-Plugin","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/BatchLabs/Batch-Cordova-Plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Cordova-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Cordova-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Cordova-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Cordova-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BatchLabs","download_url":"https://codeload.github.com/BatchLabs/Batch-Cordova-Plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Cordova-Plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018708,"owners_count":26086606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T13:24:48.368Z","updated_at":"2025-10-14T13:25:10.054Z","avatar_url":"https://github.com/BatchLabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://static.batch.com/documentation/Readmes/logo_batch_full_178@2x.png\" srcset=\"https://static.batch.com/documentation/Readmes/logo_batch_full_178.png 1x\" width=\"178\" height=\"68\" alt=\"Batch Logo\" /\u003e\n\n# Batch Cordova Plugin\n\n[![npm version](https://badge.fury.io/js/@batch.com%2Fcordova-plugin.svg)](https://badge.fury.io/js/@batch.com%2Fcordova-plugin)\n\nWelcome to Batch's Cordova Plugin!\n\nThis repository contains the plugin's source code (native code + cordova) and buildscripts.\n\n## Compatibility\n\n### Cordova\n\nThis plugin is compatible with:\n\n- cordova 9.0.0+\n- cordova-android 9.0.0+\n- cordova-ios 6.0.0+\n\nSubsequent major Cordova and Cordova platform versions are _not_ supported until told otherwise.\n\nIf you use an earlier version of Cordova, please use the 1.7.4 or 2.X version of this plugin.\n\n\u003e Note: Batch isn't supported in the browser. It will only work correctly when running on Android or iOS.\n\n### Ionic\n\nBatch requires Ionic CLI 6.0 and Capacitor 2.4 or newer.\n\nIf you're using Ionic with Cordova, cordova version requirements apply.\n\n## How do I install the plugin?\n\nSimply add our plugin from npm:\n\n```\ncordova plugin add @batch.com/cordova-plugin\n```\n\nIonic Capacitor:\n```\nnpm i @batch.com/cordova-plugin\nnpx cap sync\n```\n\nA `batch` object will be present on the window. Its methods and modules are documented in `types/index.d.ts`\n\nOur [official documentation](https://batch.com/doc/cordova/sdk-integration/initial-setup.html) will walk you through the integration process, describing how to perform a successful integration of both required and optional plugin features.\n\n# Development\n\nIf you're reading this, you're probably interested in how to tweak the code.\nThis section will cover the location of the various files and how to build/test your changes.\n\n## Folder architecture\n\nThis folder is actually the plugin's source and builder, but not the plugin itself.  \nHere is a quick overview of the different folders:\n\n- `__mocks__`: jest global mocks\n- `__tests__`: jest unit tests\n- `dist`: Plugin's actual directory. This is the one published to npm, and the one you will want to add to your project once modified.\n  - `dist/scripts`: After-prepare script that pulls Firebase keys from `google-services.json` on Android\n  - `dist/src/android`: Android native component\n  - `dist/src/ios`: iOS native component\n  - `dist/www`: Built plugin javascript. Do not edit this directly.\n- `src`: Plugin's source.\n- `types`: Plugin's type definition. This is where the plugin's public API is defined. Plugin's implementations (mobile and stub) both implement the interfaces defined in this folder.\n\n## How it works\n\nThe plugin's public API is defined by Typescript type definitions in `types`.  \nIt is then implemented, in Typescript of course, in the src folder.  \nCurrently, two implementations of the SDK exist:\n\n- Native, used on Android/iOS: this one is the real deal.\n- Stub, used on unsupported platforms: as the name implies, it does absolutely nothing but prevents your code from throwing errors.\n\nThe plugin converts Javascript API calls to a JSON-based message format unifying both platforms, and then forwards it to the native part using cordova APIs.\n\nMessages are interpreted by BatchCordovaPlugin and processed using what is called the \"Bridge\": the native implementation of the standardized JSON-based message format.\n\nOnce the Javascript side of the plugin called the native once, a two way communication bridge is established which allows the native code to tell the Javascript plugin about various SDK events, such as received push messages or in-app messaging events.\n\n## Working on the plugin\n\nBefore changing anything, you will have to install the required modules by running:\n\n```\nnpm ci\n```\n\nFiles are formatted using Prettier, and linted with ESLint.  \nWhile you should install these plugins for your favorite code editor, you can manually lint the plugin:\n\n```\nnpm run lint\n```\n\nYou can then test your changes using:\n\n```\nnpm run test\n```\n\nFinally, once you're done and want to test in your application, you will need to build `dist/www/batch.js`:\n\n```\nnpm run build\n```\n\nThen, link the plugin to your test application. This only needs to be done once.  \n```bash\nmkdir -p plugins/@batch.com\ncordova plugin add ../\u003crelative path to where you cloned this repository\u003e/Batch-Cordova-Plugin/dist/ --link\n\n# Ionic Capacitor users:\nnpm link ../\u003cpath to where you checked out the plugin\u003e/dist\n```\n\nThat's it! Happy hacking!\n\n## Applying the changes to a local project\n\nSince you've locally modified this project, you won't be able to publish it on npm.\nThus, you'll have to manually add it to your project, using the cordova CLI:\n\n```\ncordova plugin rm com.batch.cordova\n#or\ncordova plugin rm @batch.com/cordova-plugin\ncordova plugin add \u003cpath to where you checked out cordova-plugin\u003e/dist --nofetch\n```\n\nMake sure you build the plugin beforehand, no prebuilt is commited to git.\n\n# License\n\nMIT. See `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-cordova-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbatchlabs%2Fbatch-cordova-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-cordova-plugin/lists"}