@binoban/react-native 1.0.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/BinobanReactNative.podspec +23 -0
- package/LICENSE +20 -0
- package/README.md +228 -0
- package/android/build.gradle +77 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/io/binoban/sdk/reactNative/BinobanReactNativeModule.kt +248 -0
- package/android/src/main/java/io/binoban/sdk/reactNative/BinobanReactNativePackage.kt +32 -0
- package/android/src/main/java/io/binoban/sdk/reactNative/BinobanSafe.kt +22 -0
- package/android/src/main/java/io/binoban/sdk/reactNative/utils.kt +87 -0
- package/ios/BinobanReactNative.h +7 -0
- package/ios/BinobanReactNative.mm +244 -0
- package/lib/module/NativeBinobanReactNative.js +18 -0
- package/lib/module/NativeBinobanReactNative.js.map +1 -0
- package/lib/module/binobanClient.js +143 -0
- package/lib/module/binobanClient.js.map +1 -0
- package/lib/module/constants.js +31 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.js +94 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeBinobanReactNative.d.ts +101 -0
- package/lib/typescript/src/NativeBinobanReactNative.d.ts.map +1 -0
- package/lib/typescript/src/binobanClient.d.ts +30 -0
- package/lib/typescript/src/binobanClient.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +3 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +53 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +173 -0
- package/react-native.config.js +8 -0
- package/src/NativeBinobanReactNative.ts +168 -0
- package/src/binobanClient.ts +199 -0
- package/src/constants.ts +30 -0
- package/src/index.tsx +105 -0
- package/src/types.ts +78 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { CodegenTypes } from 'react-native';
|
|
3
|
+
import type { BinobanError } from './types';
|
|
4
|
+
export type NotificationInteractionEvent = {
|
|
5
|
+
notificationUuid: string;
|
|
6
|
+
type: string;
|
|
7
|
+
actionId?: string | null;
|
|
8
|
+
uri?: string | null;
|
|
9
|
+
customData?: CodegenTypes.UnsafeObject | null;
|
|
10
|
+
reason?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type NativeErrorEvent = {
|
|
13
|
+
message: string;
|
|
14
|
+
name?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export type ApiCredential = {
|
|
17
|
+
apiKey: string;
|
|
18
|
+
sourceIdentifier: string;
|
|
19
|
+
};
|
|
20
|
+
export type BaseConfig = {
|
|
21
|
+
apiHost: string;
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
collectDeviceId?: boolean;
|
|
24
|
+
trackAppLifecycleEvents?: boolean;
|
|
25
|
+
useLifecycleObserver?: boolean;
|
|
26
|
+
trackDeepLinks?: boolean;
|
|
27
|
+
flushAt?: number;
|
|
28
|
+
flushInterval?: number;
|
|
29
|
+
autoAddSegmentDestination?: boolean;
|
|
30
|
+
disableTelemetry?: boolean;
|
|
31
|
+
telemetryHost?: string;
|
|
32
|
+
uploadMaxRetries?: number;
|
|
33
|
+
backoffBaseMillis?: number;
|
|
34
|
+
backoffFactor?: number;
|
|
35
|
+
backoffMaxMillis?: number;
|
|
36
|
+
maxFilesPerFlush?: number;
|
|
37
|
+
};
|
|
38
|
+
export type Config = {
|
|
39
|
+
apiHost: string;
|
|
40
|
+
debug?: boolean;
|
|
41
|
+
collectDeviceId?: boolean;
|
|
42
|
+
trackAppLifecycleEvents?: boolean;
|
|
43
|
+
useLifecycleObserver?: boolean;
|
|
44
|
+
trackDeepLinks?: boolean;
|
|
45
|
+
flushAt?: number;
|
|
46
|
+
flushInterval?: number;
|
|
47
|
+
autoAddSegmentDestination?: boolean;
|
|
48
|
+
disableTelemetry?: boolean;
|
|
49
|
+
telemetryHost?: string;
|
|
50
|
+
uploadMaxRetries?: number;
|
|
51
|
+
backoffBaseMillis?: number;
|
|
52
|
+
backoffFactor?: number;
|
|
53
|
+
backoffMaxMillis?: number;
|
|
54
|
+
maxFilesPerFlush?: number;
|
|
55
|
+
credentials: {
|
|
56
|
+
android: ApiCredential;
|
|
57
|
+
iOS: ApiCredential;
|
|
58
|
+
};
|
|
59
|
+
onError?: (error: BinobanError) => void;
|
|
60
|
+
};
|
|
61
|
+
export type InternalConfig = {
|
|
62
|
+
apiHost: string;
|
|
63
|
+
debug?: boolean;
|
|
64
|
+
collectDeviceId?: boolean;
|
|
65
|
+
trackAppLifecycleEvents?: boolean;
|
|
66
|
+
useLifecycleObserver?: boolean;
|
|
67
|
+
trackDeepLinks?: boolean;
|
|
68
|
+
flushAt?: number;
|
|
69
|
+
flushInterval?: number;
|
|
70
|
+
autoAddSegmentDestination?: boolean;
|
|
71
|
+
disableTelemetry?: boolean;
|
|
72
|
+
telemetryHost?: string;
|
|
73
|
+
uploadMaxRetries?: number;
|
|
74
|
+
backoffBaseMillis?: number;
|
|
75
|
+
backoffFactor?: number;
|
|
76
|
+
backoffMaxMillis?: number;
|
|
77
|
+
maxFilesPerFlush?: number;
|
|
78
|
+
apiKey: string;
|
|
79
|
+
sourceIdentifier: string;
|
|
80
|
+
};
|
|
81
|
+
export interface Spec extends TurboModule {
|
|
82
|
+
readonly setup: (config: InternalConfig) => boolean;
|
|
83
|
+
readonly track: (eventName: string, properties?: Object) => void;
|
|
84
|
+
readonly identify: (userId: string, userTraits?: Object) => void;
|
|
85
|
+
readonly flush: () => void;
|
|
86
|
+
readonly reset: () => void;
|
|
87
|
+
readonly anonymousId: () => string | undefined;
|
|
88
|
+
readonly userId: () => string | undefined;
|
|
89
|
+
readonly deviceId: () => string | undefined;
|
|
90
|
+
readonly notify: (payloadData: Object) => void;
|
|
91
|
+
readonly setDeviceToken: (token: string) => void;
|
|
92
|
+
readonly onNotificationInteraction: CodegenTypes.EventEmitter<NotificationInteractionEvent>;
|
|
93
|
+
readonly onNativeError: CodegenTypes.EventEmitter<NativeErrorEvent>;
|
|
94
|
+
readonly getInitialNotificationInteraction: () => Promise<NotificationInteractionEvent | null>;
|
|
95
|
+
readonly didReceiveNotificationResponse: (userInfo: Object, actionId?: string | null, dismissed?: boolean) => void;
|
|
96
|
+
readonly willPresentNotification: (userInfo: Object) => void;
|
|
97
|
+
readonly didReceiveRemoteNotification: (userInfo: Object) => void;
|
|
98
|
+
}
|
|
99
|
+
declare const BinobanReactNative: Spec | null;
|
|
100
|
+
export default BinobanReactNative;
|
|
101
|
+
//# sourceMappingURL=NativeBinobanReactNative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBinobanReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeBinobanReactNative.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,MAAM,MAAM,4BAA4B,GAAG;IACzC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,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its, BinobanError, JsonMap, NotificationInteraction, NotificationInteractionSubscription } from './types';
|
|
3
|
+
type OnError = (error: BinobanError) => void;
|
|
4
|
+
export declare class BinobanClient {
|
|
5
|
+
private config;
|
|
6
|
+
private onError?;
|
|
7
|
+
constructor({ config, onError, }: {
|
|
8
|
+
config: InternalConfig;
|
|
9
|
+
onError?: OnError;
|
|
10
|
+
});
|
|
11
|
+
private safe;
|
|
12
|
+
init(): Promise<boolean | undefined>;
|
|
13
|
+
private subscribeToNativeErrors;
|
|
14
|
+
track(eventName: string, properties?: Object): Promise<void>;
|
|
15
|
+
identify(userId: string, userTraits?: UserTraits): Promise<void>;
|
|
16
|
+
flush(): Promise<void>;
|
|
17
|
+
reset(): Promise<void>;
|
|
18
|
+
anonymousId(): string | undefined;
|
|
19
|
+
userId(): string | undefined;
|
|
20
|
+
deviceId(): string | undefined;
|
|
21
|
+
notify(payloadData: Object): void;
|
|
22
|
+
setDeviceToken(token: string): void;
|
|
23
|
+
onNotificationInteraction(listener: (interaction: NotificationInteraction) => void): NotificationInteractionSubscription;
|
|
24
|
+
getInitialNotificationInteraction(): Promise<NotificationInteraction | null>;
|
|
25
|
+
didReceiveNotificationResponse(userInfo: JsonMap, actionId?: string | null, dismissed?: boolean): void;
|
|
26
|
+
willPresentNotification(userInfo: JsonMap): void;
|
|
27
|
+
didReceiveRemoteNotification(userInfo: JsonMap): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=binobanClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binobanClient.d.ts","sourceRoot":"","sources":["../../../src/binobanClient.ts"],"names":[],"mappings":"AAAA,OAA2B,EACzB,KAAK,cAAc,EAGpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,OAAO,EACP,uBAAuB,EAEvB,mCAAmC,EACpC,MAAM,SAAS,CAAC;AAEjB,KAAK,OAAO,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAmB7C,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,OAAO,CAAC,CAAU;gBAEd,EACV,MAAM,EACN,OAAO,GACR,EAAE;QACD,MAAM,EAAE,cAAc,CAAC;QACvB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAKD,OAAO,CAAC,IAAI;IAgBN,IAAI;IAgBV,OAAO,CAAC,uBAAuB;IAYzB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAM5C,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU;IAMhD,KAAK;IAML,KAAK;IAMX,WAAW;IAIX,MAAM;IAIN,QAAQ;IAIR,MAAM,CAAC,WAAW,EAAE,MAAM;IAM1B,cAAc,CAAC,KAAK,EAAE,MAAM;IAQ5B,yBAAyB,CACvB,QAAQ,EAAE,CAAC,WAAW,EAAE,uBAAuB,KAAK,IAAI,GACvD,mCAAmC;IAiBhC,iCAAiC,IAAI,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAYlF,8BAA8B,CAC5B,QAAQ,EAAE,OAAO,EACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,CAAC,EAAE,OAAO;IAWrB,uBAAuB,CAAC,QAAQ,EAAE,OAAO;IAMzC,4BAA4B,CAAC,QAAQ,EAAE,OAAO;CAK/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,MA2B3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Config } from './NativeBinobanReactNative';
|
|
3
|
+
import type { ClientMethods } from './types';
|
|
4
|
+
import { BinobanClient } from './binobanClient';
|
|
5
|
+
export declare const createClient: (config: Config) => BinobanClient;
|
|
6
|
+
export declare const BinobanProvider: ({ client, children, }: {
|
|
7
|
+
client?: BinobanClient;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare const useBinoban: () => ClientMethods;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,kBA+C1C,CAAC;AAIF,eAAO,MAAM,eAAe,GAAI,uBAG7B;IACD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,mDAMA,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,aAgC7B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type JsonValue = boolean | number | string | null | JsonList | JsonMap | undefined;
|
|
2
|
+
export interface JsonMap {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
[index: number]: JsonValue;
|
|
5
|
+
}
|
|
6
|
+
export type JsonList = Array<JsonValue>;
|
|
7
|
+
export type UserTraits = JsonMap & {
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
phone?: string;
|
|
11
|
+
birthday?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
gender?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
username?: string;
|
|
18
|
+
website?: string;
|
|
19
|
+
};
|
|
20
|
+
export type NotificationInteractionType = 'DELIVERED' | 'CLICKED' | 'CLOSED' | 'FAILED' | 'OPENED';
|
|
21
|
+
export type NotificationInteraction = {
|
|
22
|
+
notificationUuid: string;
|
|
23
|
+
type: NotificationInteractionType;
|
|
24
|
+
actionId?: string | null;
|
|
25
|
+
uri?: string | null;
|
|
26
|
+
customData?: Record<string, string> | null;
|
|
27
|
+
reason?: string | null;
|
|
28
|
+
};
|
|
29
|
+
export type NotificationInteractionSubscription = {
|
|
30
|
+
remove: () => void;
|
|
31
|
+
};
|
|
32
|
+
export type ClientMethods = {
|
|
33
|
+
track: (event: string, properties?: JsonMap) => void;
|
|
34
|
+
identify: (userId: string, userTraits?: UserTraits) => void;
|
|
35
|
+
flush: () => void;
|
|
36
|
+
reset: () => void;
|
|
37
|
+
anonymousId: () => string | undefined;
|
|
38
|
+
userId: () => string | undefined;
|
|
39
|
+
deviceId: () => string | undefined;
|
|
40
|
+
notify: (payloadData: JsonMap) => void;
|
|
41
|
+
setDeviceToken: (token: string) => void;
|
|
42
|
+
onNotificationInteraction: (listener: (interaction: NotificationInteraction) => void) => NotificationInteractionSubscription;
|
|
43
|
+
getInitialNotificationInteraction: () => Promise<NotificationInteraction | null>;
|
|
44
|
+
didReceiveNotificationResponse: (userInfo: JsonMap, actionId?: string | null, dismissed?: boolean) => void;
|
|
45
|
+
willPresentNotification: (userInfo: JsonMap) => void;
|
|
46
|
+
didReceiveRemoteNotification: (userInfo: JsonMap) => void;
|
|
47
|
+
};
|
|
48
|
+
export type BinobanError = {
|
|
49
|
+
method: string;
|
|
50
|
+
message: string;
|
|
51
|
+
cause?: unknown;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["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
1
|
+
{
|
|
2
|
+
"name": "@binoban/react-native",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native SDK for Binoban",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!android/src/test",
|
|
30
|
+
"!**/__tests__",
|
|
31
|
+
"!**/__fixtures__",
|
|
32
|
+
"!**/__mocks__",
|
|
33
|
+
"!**/.*"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"example": "yarn workspace binoban-react-native-example",
|
|
37
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
38
|
+
"prepare": "bob build",
|
|
39
|
+
"typecheck": "tsc",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"ci": "yarn lint && yarn typecheck && yarn test",
|
|
42
|
+
"release": "release-it --only-version",
|
|
43
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\""
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"react-native",
|
|
47
|
+
"ios",
|
|
48
|
+
"android"
|
|
49
|
+
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/binoban/binoban-example-react-native.git"
|
|
53
|
+
},
|
|
54
|
+
"author": "farhan <farhan@binoban.io> (https://docs.binoban.io)",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/binoban/binoban-example-react-native/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/binoban/binoban-example-react-native#readme",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org/",
|
|
62
|
+
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
66
|
+
"@eslint/compat": "^1.3.2",
|
|
67
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
68
|
+
"@eslint/js": "^9.35.0",
|
|
69
|
+
"@react-native-community/cli": "^20.1.3",
|
|
70
|
+
"@react-native/babel-preset": "0.83.0",
|
|
71
|
+
"@react-native/eslint-config": "0.83.0",
|
|
72
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
73
|
+
"@types/jest": "^29.5.14",
|
|
74
|
+
"@types/react": "^19.2.0",
|
|
75
|
+
"commitlint": "^19.8.1",
|
|
76
|
+
"del-cli": "^6.0.0",
|
|
77
|
+
"eslint": "^9.35.0",
|
|
78
|
+
"eslint-config-prettier": "^10.1.8",
|
|
79
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
80
|
+
"jest": "^29.7.0",
|
|
81
|
+
"lefthook": "^2.0.3",
|
|
82
|
+
"prettier": "^2.8.8",
|
|
83
|
+
"react": "19.2.0",
|
|
84
|
+
"react-native": "0.83.0",
|
|
85
|
+
"react-native-builder-bob": "^0.40.13",
|
|
86
|
+
"release-it": "^19.0.4",
|
|
87
|
+
"turbo": "^2.5.6",
|
|
88
|
+
"typescript": "^5.9.2"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": ">=18.0.0",
|
|
92
|
+
"react-native": ">=0.71.0"
|
|
93
|
+
},
|
|
94
|
+
"workspaces": [
|
|
95
|
+
"example"
|
|
96
|
+
],
|
|
97
|
+
"packageManager": "yarn@4.11.0",
|
|
98
|
+
"react-native-builder-bob": {
|
|
99
|
+
"source": "src",
|
|
100
|
+
"output": "lib",
|
|
101
|
+
"targets": [
|
|
102
|
+
[
|
|
103
|
+
"module",
|
|
104
|
+
{
|
|
105
|
+
"esm": true
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
"typescript",
|
|
110
|
+
{
|
|
111
|
+
"project": "tsconfig.build.json"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"codegenConfig": {
|
|
117
|
+
"name": "BinobanReactNativeSpec",
|
|
118
|
+
"type": "modules",
|
|
119
|
+
"jsSrcsDir": "src",
|
|
120
|
+
"android": {
|
|
121
|
+
"javaPackageName": "io.binoban.sdk.reactNative"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"jest": {
|
|
125
|
+
"preset": "react-native",
|
|
126
|
+
"modulePathIgnorePatterns": [
|
|
127
|
+
"<rootDir>/example/node_modules",
|
|
128
|
+
"<rootDir>/lib/"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"commitlint": {
|
|
132
|
+
"extends": [
|
|
133
|
+
"@commitlint/config-conventional"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"release-it": {
|
|
137
|
+
"git": {
|
|
138
|
+
"commitMessage": "chore: release ${version}",
|
|
139
|
+
"tagName": "v${version}"
|
|
140
|
+
},
|
|
141
|
+
"npm": {
|
|
142
|
+
"publish": true
|
|
143
|
+
},
|
|
144
|
+
"github": {
|
|
145
|
+
"release": false
|
|
146
|
+
},
|
|
147
|
+
"plugins": {
|
|
148
|
+
"@release-it/conventional-changelog": {
|
|
149
|
+
"preset": {
|
|
150
|
+
"name": "angular"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"prettier": {
|
|
156
|
+
"quoteProps": "consistent",
|
|
157
|
+
"singleQuote": true,
|
|
158
|
+
"tabWidth": 2,
|
|
159
|
+
"trailingComma": "es5",
|
|
160
|
+
"useTabs": false
|
|
161
|
+
},
|
|
162
|
+
"create-react-native-library": {
|
|
163
|
+
"type": "turbo-module",
|
|
164
|
+
"languages": "kotlin-objc",
|
|
165
|
+
"tools": [
|
|
166
|
+
"jest",
|
|
167
|
+
"lefthook",
|
|
168
|
+
"release-it",
|
|
169
|
+
"eslint"
|
|
170
|
+
],
|
|
171
|
+
"version": "0.57.2"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// backward compatibility
|
|
2
|
+
import type { TurboModule } from 'react-native';
|
|
3
|
+
import type { CodegenTypes } from 'react-native';
|
|
4
|
+
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
|
5
|
+
import type { BinobanError } from './types';
|
|
6
|
+
|
|
7
|
+
// Emitted to JS when the user interacts with a Binoban notification (tap on the
|
|
8
|
+
// body, tap on an action button, dismissal, or a delivery report). Mirrors the KMP
|
|
9
|
+
// `NotificationInteraction` (../kotlin/.../notification/NotificationInteractionHandler.kt).
|
|
10
|
+
export type NotificationInteractionEvent = {
|
|
11
|
+
notificationUuid: string;
|
|
12
|
+
// 'DELIVERED' | 'CLICKED' | 'CLOSED' | 'FAILED' | 'OPENED'
|
|
13
|
+
type: string;
|
|
14
|
+
// null for a body tap; the action-button id for an action-button tap
|
|
15
|
+
actionId?: string | null;
|
|
16
|
+
// HTTP URL or deep link tied to the interaction (whole-notification or per-button)
|
|
17
|
+
uri?: string | null;
|
|
18
|
+
// developer-supplied customData carried by the push (string→string map)
|
|
19
|
+
customData?: CodegenTypes.UnsafeObject | null;
|
|
20
|
+
reason?: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Emitted to JS when the KMP SDK routes an internal error to its
|
|
24
|
+
// `Configuration.errorHandler` (e.g. a disabled instance from invalid config, or a
|
|
25
|
+
// contained failure at the upload/plugin boundary). Bridged to the `onError`
|
|
26
|
+
// callback passed to `createClient`.
|
|
27
|
+
export type NativeErrorEvent = {
|
|
28
|
+
message: string;
|
|
29
|
+
// best-effort throwable class name (may be null)
|
|
30
|
+
name?: string | null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ApiCredential = {
|
|
34
|
+
apiKey: string;
|
|
35
|
+
sourceIdentifier: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type BaseConfig = {
|
|
39
|
+
apiHost: string;
|
|
40
|
+
debug?: boolean;
|
|
41
|
+
collectDeviceId?: boolean;
|
|
42
|
+
trackAppLifecycleEvents?: boolean;
|
|
43
|
+
useLifecycleObserver?: boolean;
|
|
44
|
+
trackDeepLinks?: boolean;
|
|
45
|
+
flushAt?: number;
|
|
46
|
+
flushInterval?: number;
|
|
47
|
+
autoAddSegmentDestination?: boolean;
|
|
48
|
+
disableTelemetry?: boolean;
|
|
49
|
+
telemetryHost?: string;
|
|
50
|
+
// Upload resilience tunables (KMP Configuration, added in sdk 1.0.0)
|
|
51
|
+
uploadMaxRetries?: number;
|
|
52
|
+
backoffBaseMillis?: number;
|
|
53
|
+
backoffFactor?: number;
|
|
54
|
+
backoffMaxMillis?: number;
|
|
55
|
+
maxFilesPerFlush?: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type Config = {
|
|
59
|
+
apiHost: string;
|
|
60
|
+
debug?: boolean;
|
|
61
|
+
collectDeviceId?: boolean;
|
|
62
|
+
trackAppLifecycleEvents?: boolean;
|
|
63
|
+
useLifecycleObserver?: boolean;
|
|
64
|
+
trackDeepLinks?: boolean;
|
|
65
|
+
flushAt?: number;
|
|
66
|
+
flushInterval?: number;
|
|
67
|
+
autoAddSegmentDestination?: boolean;
|
|
68
|
+
disableTelemetry?: boolean;
|
|
69
|
+
telemetryHost?: string;
|
|
70
|
+
// Upload resilience tunables (KMP Configuration, added in sdk 1.0.0)
|
|
71
|
+
uploadMaxRetries?: number;
|
|
72
|
+
backoffBaseMillis?: number;
|
|
73
|
+
backoffFactor?: number;
|
|
74
|
+
backoffMaxMillis?: number;
|
|
75
|
+
maxFilesPerFlush?: number;
|
|
76
|
+
credentials: {
|
|
77
|
+
android: ApiCredential;
|
|
78
|
+
iOS: ApiCredential;
|
|
79
|
+
};
|
|
80
|
+
onError?: (error: BinobanError) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type InternalConfig = {
|
|
84
|
+
apiHost: string;
|
|
85
|
+
debug?: boolean;
|
|
86
|
+
collectDeviceId?: boolean;
|
|
87
|
+
trackAppLifecycleEvents?: boolean;
|
|
88
|
+
useLifecycleObserver?: boolean;
|
|
89
|
+
trackDeepLinks?: boolean;
|
|
90
|
+
flushAt?: number;
|
|
91
|
+
flushInterval?: number;
|
|
92
|
+
autoAddSegmentDestination?: boolean;
|
|
93
|
+
disableTelemetry?: boolean;
|
|
94
|
+
telemetryHost?: string;
|
|
95
|
+
// Upload resilience tunables (KMP Configuration, added in sdk 1.0.0)
|
|
96
|
+
uploadMaxRetries?: number;
|
|
97
|
+
backoffBaseMillis?: number;
|
|
98
|
+
backoffFactor?: number;
|
|
99
|
+
backoffMaxMillis?: number;
|
|
100
|
+
maxFilesPerFlush?: number;
|
|
101
|
+
apiKey: string;
|
|
102
|
+
sourceIdentifier: string;
|
|
103
|
+
|
|
104
|
+
// KMP Configuration (../kotlin/.../core/Configuration.kt) — what maps to this bridge:
|
|
105
|
+
// exposed here:
|
|
106
|
+
// apiKey / sourceIdentifier(writeKey), apiHost, collectDeviceId,
|
|
107
|
+
// trackApplicationLifecycleEvents, useLifecycleObserver, trackDeepLinks,
|
|
108
|
+
// flushAt, flushInterval (-> CountBased + Frequency flush policies),
|
|
109
|
+
// autoAddSegmentDestination, disableTelemetry, telemetryHost,
|
|
110
|
+
// uploadMaxRetries, backoffBaseMillis, backoffFactor, backoffMaxMillis,
|
|
111
|
+
// maxFilesPerFlush, debug (-> debugLogsEnabled)
|
|
112
|
+
// not bridgeable as plain config primitives (native objects):
|
|
113
|
+
// application, storageProvider, flushPolicies, defaultSettings,
|
|
114
|
+
// requestFactory, errorHandler, notificationConfiguration
|
|
115
|
+
// intentionally excluded:
|
|
116
|
+
// cdnHost (no CDN settings on this bridge)
|
|
117
|
+
|
|
118
|
+
//React Native
|
|
119
|
+
// logger?: DeactivableLoggerType;
|
|
120
|
+
// New flush policies
|
|
121
|
+
// flushPolicies?: FlushPolicy[];
|
|
122
|
+
// maxBatchSize?: number;
|
|
123
|
+
// defaultSettings?: SegmentAPISettings;
|
|
124
|
+
// autoAddSegmentDestination?: boolean;
|
|
125
|
+
// storePersistor?: Persistor;
|
|
126
|
+
// storePersistorSaveDelay?: number;
|
|
127
|
+
// proxy?: string;
|
|
128
|
+
// cdnProxy?: string;
|
|
129
|
+
// useSegmentEndpoints?: boolean; // Use if you want to use Segment endpoints
|
|
130
|
+
// errorHandler?: (error: SegmentError) => void;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export interface Spec extends TurboModule {
|
|
134
|
+
readonly setup: (config: InternalConfig) => boolean;
|
|
135
|
+
readonly track: (eventName: string, properties?: Object) => void;
|
|
136
|
+
readonly identify: (userId: string, userTraits?: Object) => void;
|
|
137
|
+
readonly flush: () => void;
|
|
138
|
+
readonly reset: () => void;
|
|
139
|
+
readonly anonymousId: () => string | undefined;
|
|
140
|
+
readonly userId: () => string | undefined;
|
|
141
|
+
readonly deviceId: () => string | undefined;
|
|
142
|
+
readonly notify: (payloadData: Object) => void;
|
|
143
|
+
readonly setDeviceToken: (token: string) => void;
|
|
144
|
+
|
|
145
|
+
// Notification interactions (taps/dismissals/delivery). Installs a handler that
|
|
146
|
+
// extends the KMP DefaultNotificationInteractionHandler so backend tracking is
|
|
147
|
+
// preserved, then forwards each interaction here.
|
|
148
|
+
readonly onNotificationInteraction: CodegenTypes.EventEmitter<NotificationInteractionEvent>;
|
|
149
|
+
// KMP Configuration.errorHandler bridged to JS; routed to createClient's onError.
|
|
150
|
+
readonly onNativeError: CodegenTypes.EventEmitter<NativeErrorEvent>;
|
|
151
|
+
// Cold-start pull: the interaction that launched the app from a killed state
|
|
152
|
+
// (delivered before JS could subscribe), consumed once. null if none.
|
|
153
|
+
readonly getInitialNotificationInteraction: () => Promise<NotificationInteractionEvent | null>;
|
|
154
|
+
|
|
155
|
+
// iOS only — the host AppDelegate forwards UNUserNotificationCenter callbacks here.
|
|
156
|
+
// No-ops on Android, where the SDK's trampoline delivers interactions on its own.
|
|
157
|
+
readonly didReceiveNotificationResponse: (
|
|
158
|
+
userInfo: Object,
|
|
159
|
+
actionId?: string | null,
|
|
160
|
+
dismissed?: boolean
|
|
161
|
+
) => void;
|
|
162
|
+
readonly willPresentNotification: (userInfo: Object) => void;
|
|
163
|
+
readonly didReceiveRemoteNotification: (userInfo: Object) => void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const BinobanReactNative = TurboModuleRegistry.get<Spec>('BinobanReactNative');
|
|
167
|
+
|
|
168
|
+
export default BinobanReactNative;
|