All previous URL-scheme approaches (nostrsigner:, intent:) were fundamentally
wrong for a Capacitor app. JavaScript in a WebView cannot reliably dispatch
Android intents via URL navigation.
The correct solution — used by Coracle and other Capacitor-based Nostr apps —
is the nostr-signer-capacitor-plugin which communicates with Amber via native
Android intents through the Capacitor bridge:
NostrSignerPlugin.setPackageName({ packageName: 'com.greenart7c3.nostrsigner' })
NostrSignerPlugin.isExternalSignerInstalled()
NostrSignerPlugin.getPublicKey() → { npub }
This is synchronous from the JS side, handles the entire Android intent
roundtrip natively, and returns the pubkey directly. No URL encoding,
no callback URLs, no redirects, no malformed request errors.
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
6 lines
367 B
Text
6 lines
367 B
Text
v1.0.32 — Amber login via native Capacitor plugin
|
|
|
|
- Replaced all URL-scheme hacks with nostr-signer-capacitor-plugin
|
|
- Plugin uses native Android intents directly — no nostrsigner: URL, no intent: URL, no encoding issues
|
|
- This is how Coracle and other proper Capacitor apps do it
|
|
- Requires: npm run android:build && cap sync android (plugin needs native sync)
|