@appboxo/expo-boxo-sdk 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/boxo/expo/ExpoBoxoSdkModule.kt +5 -0
- package/build/ExpoBoxoSdk.types.d.ts +11 -0
- package/build/ExpoBoxoSdk.types.d.ts.map +1 -1
- package/build/ExpoBoxoSdk.types.js.map +1 -1
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/ios/ConfigOptions.swift +3 -0
- package/ios/ConsentScreenConfigOptions.swift +25 -0
- package/ios/ExpoBoxoSdk.podspec +1 -1
- package/ios/ExpoBoxoSdkModule.swift +17 -0
- package/package.json +1 -1
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/ExpoBoxoSdk.types.ts +12 -0
- package/src/index.ts +7 -0
- package/ios/appboxoexpoboxosdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- package/ios/appboxoexpoboxosdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -170,6 +170,11 @@ class ExpoBoxoSdkModule : Module() {
|
|
|
170
170
|
.setAuthCode(authCode)
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
Function("setAuthTokens") { appId: String, tokens: Map<String, String> ->
|
|
174
|
+
Boxo.getMiniapp(appId)
|
|
175
|
+
.setAuthTokens(tokens)
|
|
176
|
+
}
|
|
177
|
+
|
|
173
178
|
Function("sendCustomEvent") { customEvent: CustomEventData ->
|
|
174
179
|
handler?.post {
|
|
175
180
|
Boxo.getMiniapp(customEvent.appId)
|
|
@@ -73,6 +73,10 @@ export type ConfigOptions = {
|
|
|
73
73
|
* use it to hide "About Page" from Miniapp menu
|
|
74
74
|
*/
|
|
75
75
|
showAboutPage?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* use it to customize the consent screen
|
|
78
|
+
*/
|
|
79
|
+
consentScreenConfig?: ConsentScreenConfig;
|
|
76
80
|
};
|
|
77
81
|
export type MiniappOptions = {
|
|
78
82
|
/**
|
|
@@ -123,4 +127,11 @@ export type MiniappData = {
|
|
|
123
127
|
description: string;
|
|
124
128
|
logo: string;
|
|
125
129
|
};
|
|
130
|
+
export type ConsentScreenConfig = {
|
|
131
|
+
title?: string;
|
|
132
|
+
noRequiredFieldsDescription?: string;
|
|
133
|
+
requiredFieldsDescription?: string;
|
|
134
|
+
allowButtonTitle?: string;
|
|
135
|
+
cancelButtonTitle?: string;
|
|
136
|
+
};
|
|
126
137
|
//# sourceMappingURL=ExpoBoxoSdk.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoBoxoSdk.types.d.ts","sourceRoot":"","sources":["../src/ExpoBoxoSdk.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACn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;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC;CACnG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoBoxoSdk.types.js","sourceRoot":"","sources":["../src/ExpoBoxoSdk.types.ts"],"names":[],"mappings":"","sourcesContent":["export type AuthEventPayload = {\n appId: string;\n};\n\nexport type PaymentData = {\n appId: string;\n transactionToken?: string;\n miniappOrderId?: string;\n amount?: number;\n currency?: string;\n extraParams?: Record<string, any>;\n hostappOrderId?: string;\n status?: string;\n};\n\nexport type CustomEventData = {\n appId: string;\n requestId?: number;\n type?: string;\n errorType?: string;\n payload?: Record<string, any>;\n};\n\nexport type LifecycleData = {\n appId: string;\n /**\n * onLaunch - Called when the miniapp will launch with Boxo.open(...)\n * onResume - Called when the miniapp will start interacting with the user\n * onPause - Called when the miniapp loses foreground state\n * onClose - Called when clicked close button in miniapp or when destroyed miniapp page\n * onError - Called when miniapp fails to launch due to internet connection issues\n * onUserInteraction - Called whenever touch event is dispatched to the miniapp page.\n */\n lifecycle: string;\n error?: string\n};\n\nexport type ConfigOptions = {\n /**\n * your client id from dashboard\n */\n clientId: string;\n /**\n * hostapp userId, will be used for the Consent Management\n */\n userId?: string;\n /**\n * language value will be passed to the miniapp\n */\n language?: string;\n /**\n * switch to sandbox mode\n */\n sandboxMode?: boolean;\n /**\n * Each miniapp appears as a task in the Recents screen.\n * !It works only on android devices.\n */\n multitaskMode?: boolean;\n /**\n * theme for splash screen and other native components used inside miniapp.\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * enables webview debugging\n */\n isDebug?: boolean;\n /**\n * use it to hide \"Settings\" from Miniapp menu\n */\n showPermissionsPage?: boolean;\n /**\n * use it to hide \"Clear cache\" from Miniapp menu\n */\n showClearCache?: boolean;\n\n /**\n * use it to hide \"About Page\" from Miniapp menu\n */\n showAboutPage?: boolean;\n};\n\nexport type MiniappOptions = {\n /**\n * miniapp id\n */\n appId: string;\n /**\n * (optional) data as Map that is sent to miniapp\n */\n data?: Record<string, any>;\n /**\n * (optional) miniapp theme 'dark' | 'light' | 'system' (by default is system theme)\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n extraUrlParams?: Record<string, string>;\n /**\n * (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n urlSuffix?: string;\n /**\n * (optional) provide colors to miniapp if miniapp supports\n */\n colors?: Record<string, string>;\n /**\n * (optional) use to skip miniapp splash screen\n */\n enableSplash?: boolean;\n /**\n * (optional) use to save state on close miniapp\n */\n saveState?: boolean;\n /**\n * (optional) use to change launch animation for miniapp.\n */\n pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';\n};\n\nexport type MiniappListResult = {\n miniapps?: Array<MiniappData>;\n error?: string;\n}\n\nexport type MiniappData = {\n appId: string;\n name: string;\n category: string;\n description: string;\n logo: string;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoBoxoSdk.types.js","sourceRoot":"","sources":["../src/ExpoBoxoSdk.types.ts"],"names":[],"mappings":"","sourcesContent":["export type AuthEventPayload = {\n appId: string;\n};\n\nexport type PaymentData = {\n appId: string;\n transactionToken?: string;\n miniappOrderId?: string;\n amount?: number;\n currency?: string;\n extraParams?: Record<string, any>;\n hostappOrderId?: string;\n status?: string;\n};\n\nexport type CustomEventData = {\n appId: string;\n requestId?: number;\n type?: string;\n errorType?: string;\n payload?: Record<string, any>;\n};\n\nexport type LifecycleData = {\n appId: string;\n /**\n * onLaunch - Called when the miniapp will launch with Boxo.open(...)\n * onResume - Called when the miniapp will start interacting with the user\n * onPause - Called when the miniapp loses foreground state\n * onClose - Called when clicked close button in miniapp or when destroyed miniapp page\n * onError - Called when miniapp fails to launch due to internet connection issues\n * onUserInteraction - Called whenever touch event is dispatched to the miniapp page.\n */\n lifecycle: string;\n error?: string\n};\n\nexport type ConfigOptions = {\n /**\n * your client id from dashboard\n */\n clientId: string;\n /**\n * hostapp userId, will be used for the Consent Management\n */\n userId?: string;\n /**\n * language value will be passed to the miniapp\n */\n language?: string;\n /**\n * switch to sandbox mode\n */\n sandboxMode?: boolean;\n /**\n * Each miniapp appears as a task in the Recents screen.\n * !It works only on android devices.\n */\n multitaskMode?: boolean;\n /**\n * theme for splash screen and other native components used inside miniapp.\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * enables webview debugging\n */\n isDebug?: boolean;\n /**\n * use it to hide \"Settings\" from Miniapp menu\n */\n showPermissionsPage?: boolean;\n /**\n * use it to hide \"Clear cache\" from Miniapp menu\n */\n showClearCache?: boolean;\n\n /**\n * use it to hide \"About Page\" from Miniapp menu\n */\n showAboutPage?: boolean;\n\n /**\n * use it to customize the consent screen\n */\n consentScreenConfig?: ConsentScreenConfig\n};\n\nexport type MiniappOptions = {\n /**\n * miniapp id\n */\n appId: string;\n /**\n * (optional) data as Map that is sent to miniapp\n */\n data?: Record<string, any>;\n /**\n * (optional) miniapp theme 'dark' | 'light' | 'system' (by default is system theme)\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n extraUrlParams?: Record<string, string>;\n /**\n * (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n urlSuffix?: string;\n /**\n * (optional) provide colors to miniapp if miniapp supports\n */\n colors?: Record<string, string>;\n /**\n * (optional) use to skip miniapp splash screen\n */\n enableSplash?: boolean;\n /**\n * (optional) use to save state on close miniapp\n */\n saveState?: boolean;\n /**\n * (optional) use to change launch animation for miniapp.\n */\n pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';\n};\n\nexport type MiniappListResult = {\n miniapps?: Array<MiniappData>;\n error?: string;\n}\n\nexport type MiniappData = {\n appId: string;\n name: string;\n category: string;\n description: string;\n logo: string;\n}\n\nexport type ConsentScreenConfig = {\n title?: string;\n noRequiredFieldsDescription?: string;\n requiredFieldsDescription?: string;\n allowButtonTitle?: string;\n cancelButtonTitle?: string;\n};"]}
|
package/build/index.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ export declare function openMiniapp(options: MiniappOptions): void;
|
|
|
12
12
|
* get AuthCode from hostapp backend and send it to miniapp
|
|
13
13
|
*/
|
|
14
14
|
export declare function setAuthCode(appId: string, authCode: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* get AuthTokens from hostapp backend and send it to miniapp
|
|
17
|
+
*/
|
|
18
|
+
export declare function setAuthTokens(appId: string, tokens: Record<string, string>): void;
|
|
15
19
|
/**
|
|
16
20
|
* send payment event to miniapp
|
|
17
21
|
*/
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEnK;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,QAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,QAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAE1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,QAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,QAErD;AAED;;GAEG;AACH,wBAAgB,MAAM,SAErB;AAED;;;GAGG;AACH,wBAAgB,YAAY,SAE3B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,QAEzC;AAED;;GAEG;AACH,wBAAgB,WAAW,SAE1B;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,YAAY,CAEzF;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC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GAGG;AACH,wBAAgB,YAAY,SAE3B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,QAEzC;AAED;;GAEG;AACH,wBAAgB,WAAW,SAE1B;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,YAAY,CAEzF;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,YAAY,CAE/F;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,YAAY,CAE5F;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,GAAG,YAAY,CAE1G;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,YAAY,CAElG;AAED,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -18,6 +18,12 @@ export function openMiniapp(options) {
|
|
|
18
18
|
export function setAuthCode(appId, authCode) {
|
|
19
19
|
ExpoBoxoSdkModule.setAuthCode(appId, authCode);
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* get AuthTokens from hostapp backend and send it to miniapp
|
|
23
|
+
*/
|
|
24
|
+
export function setAuthTokens(appId, tokens) {
|
|
25
|
+
ExpoBoxoSdkModule.setAuthTokens(appId, tokens);
|
|
26
|
+
}
|
|
21
27
|
/**
|
|
22
28
|
* send payment event to miniapp
|
|
23
29
|
*/
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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AQ,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAA0C;IAC/E,OAAO,OAAO,CAAC,WAAW,CAAkB,aAAa,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAsC;IAC5E,OAAO,OAAO,CAAC,WAAW,CAAc,cAAc,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,QAAgD;IAC1F,OAAO,OAAO,CAAC,WAAW,CAAgB,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAA6C;IAClF,OAAO,OAAO,CAAC,WAAW,CAAoB,aAAa,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';\n\nimport ExpoBoxoSdkModule from './ExpoBoxoSdkModule';\nimport { MiniappListResult, MiniappData, LifecycleData, CustomEventData, PaymentData, AuthEventPayload, ConfigOptions, MiniappOptions } from './ExpoBoxoSdk.types';\n\n/**\n * Set global configs\n */\nexport function setConfig(options: ConfigOptions) {\n ExpoBoxoSdkModule.setConfig(options);\n}\n\n/**\n * Open miniapp with options\n */\nexport function openMiniapp(options: MiniappOptions) {\n ExpoBoxoSdkModule.openMiniapp(options);\n}\n\n/**\n * get AuthCode from hostapp backend and send it to miniapp\n */\nexport function setAuthCode(appId: string, authCode: string) {\n ExpoBoxoSdkModule.setAuthCode(appId, authCode);\n}\n\n/**\n * send payment event to miniapp\n */\nexport function sendPaymentEvent(paymentData: PaymentData) {\n ExpoBoxoSdkModule.sendPaymentEvent(paymentData);\n}\n\n/**\n * send custom event to miniapp\n */\nexport function sendCustomEvent(event: CustomEventData) {\n ExpoBoxoSdkModule.sendCustomEvent(event);\n}\n\n/**\n * When host app user logs out, it is highly important to clear all miniapp storage data.\n */\nexport function logout() {\n ExpoBoxoSdkModule.logout();\n}\n\n/**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n * To use this function need to enable 'multitaskMode: true' in Boxo.setConfig()\n */\nexport function hideMiniapps() {\n ExpoBoxoSdkModule.hideMiniapps();\n}\n\n/**\n * close miniapp by appId\n */\nexport function closeMiniapp(appId: string) {\n ExpoBoxoSdkModule.closeMiniapp(appId);\n}\n\n/**\n * Get list of miniapps\n */\nexport function getMiniapps() {\n ExpoBoxoSdkModule.getMiniapps();\n}\n\nconst emitter = new EventEmitter(ExpoBoxoSdkModule ?? NativeModulesProxy.ExpoBoxoSdk);\n\nexport function addAuthListener(listener: (event: AuthEventPayload) => void): Subscription {\n return emitter.addListener<AuthEventPayload>('onAuth', listener);\n}\n\nexport function addCustomEventListener(listener: (event: CustomEventData) => void): Subscription {\n return emitter.addListener<CustomEventData>('customEvent', listener);\n}\n\nexport function addPaymentEventListener(listener: (event: PaymentData) => void): Subscription {\n return emitter.addListener<PaymentData>('paymentEvent', listener);\n}\n\nexport function addMiniappLifecycleListener(listener: (lifecycleData: LifecycleData) => void): Subscription {\n return emitter.addListener<LifecycleData>('miniappLifecycle', listener);\n}\n\nexport function addMiniappListListener(listener: (result: MiniappListResult) => void): Subscription {\n return emitter.addListener<MiniappListResult>('miniappList', listener);\n}\n\nexport { MiniappListResult, MiniappData, LifecycleData, CustomEventData, PaymentData, AuthEventPayload, ConfigOptions, MiniappOptions };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAEnF,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAGpD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAsB;IAC9C,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,OA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QAAQ,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAsC;IAC5E,OAAO,OAAO,CAAC,WAAW,CAAc,cAAc,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,QAAgD;IAC1F,OAAO,OAAO,CAAC,WAAW,CAAgB,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAA6C;IAClF,OAAO,OAAO,CAAC,WAAW,CAAoB,aAAa,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';\n\nimport ExpoBoxoSdkModule from './ExpoBoxoSdkModule';\nimport { MiniappListResult, MiniappData, LifecycleData, CustomEventData, PaymentData, AuthEventPayload, ConfigOptions, MiniappOptions } from './ExpoBoxoSdk.types';\n\n/**\n * Set global configs\n */\nexport function setConfig(options: ConfigOptions) {\n ExpoBoxoSdkModule.setConfig(options);\n}\n\n/**\n * Open miniapp with options\n */\nexport function openMiniapp(options: MiniappOptions) {\n ExpoBoxoSdkModule.openMiniapp(options);\n}\n\n/**\n * get AuthCode from hostapp backend and send it to miniapp\n */\nexport function setAuthCode(appId: string, authCode: string) {\n ExpoBoxoSdkModule.setAuthCode(appId, authCode);\n}\n\n/**\n * get AuthTokens from hostapp backend and send it to miniapp\n */\nexport function setAuthTokens(appId: string, tokens: Record<string, string>){\n ExpoBoxoSdkModule.setAuthTokens(appId, tokens);\n}\n\n/**\n * send payment event to miniapp\n */\nexport function sendPaymentEvent(paymentData: PaymentData) {\n ExpoBoxoSdkModule.sendPaymentEvent(paymentData);\n}\n\n/**\n * send custom event to miniapp\n */\nexport function sendCustomEvent(event: CustomEventData) {\n ExpoBoxoSdkModule.sendCustomEvent(event);\n}\n\n/**\n * When host app user logs out, it is highly important to clear all miniapp storage data.\n */\nexport function logout() {\n ExpoBoxoSdkModule.logout();\n}\n\n/**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n * To use this function need to enable 'multitaskMode: true' in Boxo.setConfig()\n */\nexport function hideMiniapps() {\n ExpoBoxoSdkModule.hideMiniapps();\n}\n\n/**\n * close miniapp by appId\n */\nexport function closeMiniapp(appId: string) {\n ExpoBoxoSdkModule.closeMiniapp(appId);\n}\n\n/**\n * Get list of miniapps\n */\nexport function getMiniapps() {\n ExpoBoxoSdkModule.getMiniapps();\n}\n\nconst emitter = new EventEmitter(ExpoBoxoSdkModule ?? NativeModulesProxy.ExpoBoxoSdk);\n\nexport function addAuthListener(listener: (event: AuthEventPayload) => void): Subscription {\n return emitter.addListener<AuthEventPayload>('onAuth', listener);\n}\n\nexport function addCustomEventListener(listener: (event: CustomEventData) => void): Subscription {\n return emitter.addListener<CustomEventData>('customEvent', listener);\n}\n\nexport function addPaymentEventListener(listener: (event: PaymentData) => void): Subscription {\n return emitter.addListener<PaymentData>('paymentEvent', listener);\n}\n\nexport function addMiniappLifecycleListener(listener: (lifecycleData: LifecycleData) => void): Subscription {\n return emitter.addListener<LifecycleData>('miniappLifecycle', listener);\n}\n\nexport function addMiniappListListener(listener: (result: MiniappListResult) => void): Subscription {\n return emitter.addListener<MiniappListResult>('miniappList', listener);\n}\n\nexport { MiniappListResult, MiniappData, LifecycleData, CustomEventData, PaymentData, AuthEventPayload, ConfigOptions, MiniappOptions };\n"]}
|
package/ios/ConfigOptions.swift
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ConsentScreenConfigOptions.swift
|
|
3
|
+
// ExpoBoxoSdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Azamat Kushmanov on 29/10/25.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import ExpoModulesCore
|
|
9
|
+
|
|
10
|
+
struct ConsentScreenConfigOptions : Record {
|
|
11
|
+
@Field
|
|
12
|
+
var title: String?
|
|
13
|
+
|
|
14
|
+
@Field
|
|
15
|
+
var noRequiredFieldsDescription: String?
|
|
16
|
+
|
|
17
|
+
@Field
|
|
18
|
+
var requiredFieldsDescription: String?
|
|
19
|
+
|
|
20
|
+
@Field
|
|
21
|
+
var allowButtonTitle: String?
|
|
22
|
+
|
|
23
|
+
@Field
|
|
24
|
+
var cancelButtonTitle: String?
|
|
25
|
+
}
|
package/ios/ExpoBoxoSdk.podspec
CHANGED
|
@@ -27,6 +27,17 @@ public class ExpoBoxoSdkModule: Module {
|
|
|
27
27
|
config.showClearCache = options.showClearCache
|
|
28
28
|
config.showAboutPage = options.showAboutPage
|
|
29
29
|
|
|
30
|
+
if let consentConfig = options.consentScreenConfig {
|
|
31
|
+
let consentScreenConfig = ConsentScreenConfig()
|
|
32
|
+
consentScreenConfig.title = consentConfig.title ?? consentScreenConfig.title
|
|
33
|
+
consentScreenConfig.noRequiredFieldsDescription = consentConfig.noRequiredFieldsDescription ?? consentScreenConfig.noRequiredFieldsDescription
|
|
34
|
+
consentScreenConfig.requiredFieldsDescription = consentConfig.requiredFieldsDescription ?? consentScreenConfig.requiredFieldsDescription
|
|
35
|
+
consentScreenConfig.allowButtonTitle = consentConfig.allowButtonTitle ?? consentScreenConfig.allowButtonTitle
|
|
36
|
+
consentScreenConfig.cancelButtonTitle = consentConfig.cancelButtonTitle ?? consentScreenConfig.cancelButtonTitle
|
|
37
|
+
|
|
38
|
+
config.consentScreenConfig = consentScreenConfig
|
|
39
|
+
}
|
|
40
|
+
|
|
30
41
|
Boxo.shared.setConfig(config: config)
|
|
31
42
|
}
|
|
32
43
|
|
|
@@ -84,6 +95,12 @@ public class ExpoBoxoSdkModule: Module {
|
|
|
84
95
|
Boxo.shared.getMiniapp(appId: appId).setAuthCode(authCode: authCode)
|
|
85
96
|
}
|
|
86
97
|
}
|
|
98
|
+
|
|
99
|
+
Function("setAuthTokens") { (appId : String, tokens: [String : Any]) in
|
|
100
|
+
DispatchQueue.main.async {
|
|
101
|
+
Boxo.shared.getMiniapp(appId: appId).setAuthTokens(tokens)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
87
104
|
|
|
88
105
|
Function("sendCustomEvent") { (customEvent : CustomEventData) in
|
|
89
106
|
let event = CustomEvent()
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/withandroidplugin.ts","./src/withiosplugin.ts"],"version":"5.
|
|
1
|
+
{"root":["./src/index.ts","./src/withandroidplugin.ts","./src/withiosplugin.ts"],"version":"5.9.3"}
|
package/src/ExpoBoxoSdk.types.ts
CHANGED
|
@@ -78,6 +78,11 @@ export type ConfigOptions = {
|
|
|
78
78
|
* use it to hide "About Page" from Miniapp menu
|
|
79
79
|
*/
|
|
80
80
|
showAboutPage?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* use it to customize the consent screen
|
|
84
|
+
*/
|
|
85
|
+
consentScreenConfig?: ConsentScreenConfig
|
|
81
86
|
};
|
|
82
87
|
|
|
83
88
|
export type MiniappOptions = {
|
|
@@ -132,3 +137,10 @@ export type MiniappData = {
|
|
|
132
137
|
logo: string;
|
|
133
138
|
}
|
|
134
139
|
|
|
140
|
+
export type ConsentScreenConfig = {
|
|
141
|
+
title?: string;
|
|
142
|
+
noRequiredFieldsDescription?: string;
|
|
143
|
+
requiredFieldsDescription?: string;
|
|
144
|
+
allowButtonTitle?: string;
|
|
145
|
+
cancelButtonTitle?: string;
|
|
146
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,13 @@ export function setAuthCode(appId: string, authCode: string) {
|
|
|
24
24
|
ExpoBoxoSdkModule.setAuthCode(appId, authCode);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* get AuthTokens from hostapp backend and send it to miniapp
|
|
29
|
+
*/
|
|
30
|
+
export function setAuthTokens(appId: string, tokens: Record<string, string>){
|
|
31
|
+
ExpoBoxoSdkModule.setAuthTokens(appId, tokens);
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
/**
|
|
28
35
|
* send payment event to miniapp
|
|
29
36
|
*/
|
|
File without changes
|
package/ios/appboxoexpoboxosdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
DELETED
|
File without changes
|