From 87318b892b7a191b975b46bcaaf81bbdb5abcad7 Mon Sep 17 00:00:00 2001 From: Sergio Vallejo Date: Mon, 8 Sep 2025 11:56:42 -0300 Subject: [PATCH] feat: Added addListener method --- src/definitions.ts | 3 +++ src/index.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/definitions.ts b/src/definitions.ts index 2ed6cbe..00d9244 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -1,9 +1,12 @@ +import { type PluginListenerHandle } from "@capacitor/core"; + export interface MetaMapParams { clientId: string flowId: string metadata?: object } export interface MetaMapCapacitorPlugin { + addListener(eventName: 'verificationCreated', listenerFunc: (data: { identityId: string, verificationID: string }) => any): Promise; showMetaMapFlow(options: MetaMapParams): Promise<{ identityId: string, verificationID: string }>; } diff --git a/src/index.ts b/src/index.ts index 4cc5a13..8a94955 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import type { MetaMapParams } from './definitions'; const MetaMapCapacitorUnwrapped = registerPlugin('MetaMapCapacitor', {}); const MetaMapCapacitor = { + addEventListener: MetaMapCapacitorUnwrapped.addListener, showMetaMapFlow: function(options: MetaMapParams):Promise<{ identityId: string, verificationID: string }> { const { metadata } = options return MetaMapCapacitorUnwrapped.showMetaMapFlow({...options, metadata: {...metadata, sdkType: "capacitor" }}) @@ -15,4 +16,4 @@ const MetaMapCapacitor = { export * from './definitions'; export { MetaMapCapacitor }; - +