# Prompt — Add a new bridge method (code)

> Generated by orbit:prompt-generator for `cordova-plugin-insider`. Target tool: Claude Code. Based on `.orbit-output/config/architecture/`.

Copy the block below, fill the `{{...}}` placeholders, and submit.

---

```xml
<context>
Project: cordova-plugin-insider — a Cordova bridge plugin wrapping the Insider native SDKs (iOS + Android), exposed to hybrid apps as the global `Insider`.
Read first: @.orbit-output/config/MASTER.md, @CODING.md.

Architecture: three layers — JS bridge (js/, built to www/) → cordova.exec → native (src/android Java, src/ios ObjC) → Insider SDK. Callbacks come back via cordova.fireDocumentEvent.

Mandatory patterns:
- Single native call path: Utils.asyncExec(InsiderConstants.CLASS, reference, args). Never call cordova.exec directly.
- Validate-first: Utils.checkParameters([{ type, value }]) then Utils.showParameterWarningLog(this.constructor.name + '-<method>') and early return on invalid input.
- Native action names are centralized in js/Constants.js.
- Errors: try/catch → Utils.asyncExec(CLASS, PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]).
- Dates cross the bridge as epoch-ms strings; consent/collection booleans as lowercased strings.
- Platform-only methods guard on cordova.platformId and no-op off-platform.
</context>

<task>
Add a new public bridge method: {{method_name}}.
Behavior: {{what_it_should_do}}
Parameters: {{params_with_types}}
Platform(s): {{both | android-only | ios-only}}
Returns: {{void | Promise<...>}}
</task>

<requirements>
- Add the action constant to js/Constants.js (UPPER_SNAKE_CASE → reference string).
- Implement the JS method in the right module (js/InsiderPlugin.js or the relevant model class) following the validate-first + asyncExec + error-wrap pattern.
- Implement the matching native handler in src/android/InsiderPlugin.java (execute dispatch) AND src/ios/InsiderPlugin.m (selector) — unless platform-only.
- Add/extend the TypeScript definition in types/.
- Add a Jest test in __tests__/ (mock cordova.exec; cover valid + invalid input; assert serialization).
</requirements>

<constraints>
- Match existing code style exactly (see neighboring methods).
- Keep three-way parity (JS + Android + iOS + types) unless the method is platform-only by design.
- Do not edit www/ (generated) or .orbit-output/ (generated).
</constraints>

<output_format>
1. Diff/edits per file, grouped by file path.
2. The new Jest test.
3. A one-line note on whether parity is full or platform-only and why.
4. Confirm `npm test` expectation.
</output_format>
```

## Context files to include
| File | Reason |
|------|--------|
| `js/InsiderPlugin.js` | Method placement + existing pattern |
| `js/Utils.js`, `js/Constants.js` | Call path + constants |
| `src/android/InsiderPlugin.java`, `src/ios/InsiderPlugin.m` | Native handlers |
| nearest `types/*.d.ts` | Type definition style |
