@truewatchtech/react-native-mobile 0.3.15 → 0.3.16

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.
Files changed (43) hide show
  1. package/FTMobileReactNativeSDK.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/ft/sdk/reactnative/FTMobileImpl.java +424 -5
  4. package/android/src/main/java/com/ft/sdk/reactnative/FTRUMImpl.java +12 -0
  5. package/android/src/newarch/java/com/ft/sdk/reactnative/FTMobileModule.java +23 -1
  6. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTMobileModule.java +24 -2
  7. package/ios/FTMobileReactNative.h +2 -2
  8. package/ios/FTMobileReactNative.m +358 -4
  9. package/ios/FTReactNativeRUM.m +9 -0
  10. package/lib/commonjs/ft_logger.js +5 -2
  11. package/lib/commonjs/ft_logger.js.map +1 -1
  12. package/lib/commonjs/ft_mobile_agent.js +142 -3
  13. package/lib/commonjs/ft_mobile_agent.js.map +1 -1
  14. package/lib/commonjs/ft_rum.js +40 -13
  15. package/lib/commonjs/ft_rum.js.map +1 -1
  16. package/lib/commonjs/ft_tracing.js.map +1 -1
  17. package/lib/commonjs/index.js +30 -0
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/version.js +1 -1
  20. package/lib/commonjs/version.js.map +1 -1
  21. package/lib/module/ft_logger.js +5 -2
  22. package/lib/module/ft_logger.js.map +1 -1
  23. package/lib/module/ft_mobile_agent.js +142 -3
  24. package/lib/module/ft_mobile_agent.js.map +1 -1
  25. package/lib/module/ft_rum.js +39 -9
  26. package/lib/module/ft_rum.js.map +1 -1
  27. package/lib/module/ft_tracing.js.map +1 -1
  28. package/lib/module/index.js +3 -3
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/version.js +1 -1
  31. package/lib/module/version.js.map +1 -1
  32. package/lib/typescript/ft_mobile_agent.d.ts +140 -2
  33. package/lib/typescript/ft_rum.d.ts +24 -0
  34. package/lib/typescript/index.d.ts +3 -3
  35. package/lib/typescript/version.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/src/ft_logger.tsx +6 -2
  38. package/src/ft_mobile_agent.tsx +217 -8
  39. package/src/ft_rum.tsx +66 -9
  40. package/src/ft_tracing.tsx +21 -2
  41. package/src/index.tsx +6 -5
  42. package/src/version.ts +1 -1
  43. package/android/src/main/java/com/ft/sdk/InnerClassProxy.java +0 -8
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_version","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EnvType","exports","FTDBCacheDiscard","FTMobileReactNativeWrapper","constructor","NativeModules","FTMobileReactNative","sdkConfig","config","serverUrl","length","datakitUrl","pkgInfo","sdkVersion","sdk","bindRUMUserData","userId","userName","userEmail","extra","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","clearAllData"],"sources":["ft_mobile_agent.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { version as sdkVersion } from './version'\n\n/**\n * Environment.\n */\nexport enum EnvType {\n prod, gray, pre, common, local\n};\nexport enum FTDBCacheDiscard { discard, discardOldest };\n/**\n * Configure SDK startup parameters.\n * @param serverUrl data reporting address, deprecated, use [datakitUrl] instead\n * @param datakitUrl datakit access URL address, example: http://10.0.0.1:9529, default port 9529. Choose one between datakit and dataway configuration\n * @param datawayUrl dataway access URL address, example: http://10.0.0.1:9528, default port 9528, note: the device installing the SDK needs to be able to access this address. Note: choose one between datakit and dataway configuration\n * @param clientToken dataway authentication token, needs to be configured together with [datawayUrl]\n * @param debug set whether to allow log printing, default false\n * @param env environment, default prod\n * @param service set the name of the business or service it belongs to, default: `df_rum_ios`, `df_rum_android`\n * @param autoSync whether data is automatically synchronized and uploaded, default: true\n * @param syncPageSize number of synchronized items per request during data synchronization, minimum value 5, default: 10\n * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100\n * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default\n * @param compressIntakeRequests whether to compress synchronized data\n * @param globalContext custom global parameters\n * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension\n * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect\n * @param dbCacheLimit db cache limit size, minimum value 30MB, default 100MB, unit byte\n * @param dbDiscardStrategy db data discard strategy\n * @param dataModifier data modifier, modify individual fields {key:value}, after setting, the SDK will replace the original value with the set value according to the key\n * @param lineDataModifier data modifier, modify single data {\"measurement\":measurement,\"data\":{key:value}}, after setting, the SDK will replace the original value with the set value according to the key\n */\n export interface FTMobileConfig {\n /**\n * @deprecated \"serverUrl\" parameter renamed to \"datakitUrl\"\n */\n serverUrl?: string,\n datakitUrl?: string,\n datawayUrl?: string,\n clientToken?: string,\n debug?:boolean,\n envType?:EnvType,\n env?:string,\n service?:string,\n autoSync?:boolean,\n syncPageSize?:number,\n syncSleepTime?:number,\n enableDataIntegerCompatible?:boolean,\n compressIntakeRequests?:boolean,\n globalContext?:object,\n groupIdentifiers?:Array<string>,\n enableLimitWithDbSize?:boolean,\n dbCacheLimit?:number,\n dbDiscardStrategy?:FTDBCacheDiscard,\n pkgInfo?: string,\n dataModifier?:object,\n lineDataModifier?:object\n }\n\n\ntype FTMobileReactNativeType = {\n\n /**\n * SDK initialization method.\n * @param config SDK initialization configuration items.\n * @returns a Promise.\n */\n sdkConfig(config:FTMobileConfig): Promise<void>;\n /**\n * Bind user.\n * @param userId user ID.\n * @param userName user name.\n * @param userEmail user email\n * @param extra additional user information\n * @returns a Promise.\n */\n bindRUMUserData(userId: string,userName?:string,userEmail?:string,extra?:object): Promise<void>;\n /**\n * Unbind user.\n * @returns a Promise.\n */\n unbindRUMUserData(): Promise<void>;\n /**\n * Add custom global parameters. Applies to RUM and Log data\n * @param context custom global parameters.\n * @returns a Promise.\n */\n appendGlobalContext(context:object):Promise<void>;\n /**\n * Add custom RUM global parameters. Applies to RUM data\n * @param context custom RUM global parameters.\n * @returns a Promise.\n */\n appendRUMGlobalContext(context:object):Promise<void>;\n /**\n * Add custom RUM and Log global parameters. Applies to Log data\n * @param context custom Log global parameters.\n * @returns a Promise.\n */\n appendLogGlobalContext(context:object):Promise<void>;\n /**\n * Actively synchronize data. When `FTMobileConfig.autoSync=false` is configured, you need to actively trigger this method to synchronize data.\n * @returns a Promise.\n */\n flushSyncData():Promise<void>;\n\n /**\n * Synchronize events in iOS Widget Extension, iOS only\n * @param groupIdentifier app groupId\n * @returns {groupIdentifier:string,datas:Array<object>} can be used to view data collected in Extension.\n */\n trackEventFromExtension(identifier:string): Promise<object>\n /**\n * Shut down objects currently running in the SDK\n */\n shutDown():Promise<void>\n /**\n * Clear all data that has not yet been uploaded to the server.\n */\n clearAllData():Promise<void>\n };\n\n class FTMobileReactNativeWrapper implements FTMobileReactNativeType {\n private sdk:FTMobileReactNativeType = NativeModules.FTMobileReactNative;\n\n sdkConfig(config:FTMobileConfig): Promise<void> {\n if(config.serverUrl != null && config.serverUrl.length>0 && config.datakitUrl == null){\n config.datakitUrl = config.serverUrl;\n }\n config.pkgInfo = sdkVersion;\n return this.sdk.sdkConfig(config);\n }\n bindRUMUserData(userId: string,userName?:string,userEmail?:string,extra?:object): Promise<void> {\n return this.sdk.bindRUMUserData(userId,userName,userEmail,extra);\n }\n unbindRUMUserData(): Promise<void> {\n return this.sdk.unbindRUMUserData();\n }\n appendGlobalContext(context: object): Promise<void> {\n return this.sdk.appendGlobalContext(context);\n }\n appendLogGlobalContext(context: object): Promise<void> {\n return this.sdk.appendLogGlobalContext(context);\n }\n appendRUMGlobalContext(context: object): Promise<void> {\n return this.sdk.appendRUMGlobalContext(context);\n }\n trackEventFromExtension(identifier:string) :Promise<object>{\n return this.sdk.trackEventFromExtension(identifier);\n }\n flushSyncData():Promise<void>{\n return this.sdk.flushSyncData();\n }\n shutDown():Promise<void>{\n return this.sdk.shutDown();\n }\n clearAllData():Promise<void>{\n return this.sdk.clearAllData();\n }\n }\nexport const FTMobileReactNative: FTMobileReactNativeType = new FTMobileReactNativeWrapper();\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAiD,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAEjD;AACA;AACA;AAFA,IAGYgB,OAAO,GAAAC,OAAA,CAAAD,OAAA,0BAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAElB;AAAC,IACUE,gBAAgB,GAAAD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B,CAACF,OAAO,CAAC;EACnD;EACAG,uBAAuBA,CAACC,UAAiB,EAAkB;IACzD,OAAO,IAAI,CAACZ,GAAG,CAACW,uBAAuB,CAACC,UAAU,CAAC;EACrD;EACAC,aAAaA,CAAA,EAAgB;IAC5B,OAAO,IAAI,CAACb,GAAG,CAACa,aAAa,CAAC,CAAC;EAChC;EACAC,QAAQA,CAAA,EAAgB;IACvB,OAAO,IAAI,CAACd,GAAG,CAACc,QAAQ,CAAC,CAAC;EAC3B;EACAC,YAAYA,CAAA,EAAgB;IAC3B,OAAO,IAAI,CAACf,GAAG,CAACe,YAAY,CAAC,CAAC;EAC/B;AACF;AACM,MAAMvB,mBAA4C,GAAAL,OAAA,CAAAK,mBAAA,GAAG,IAAIH,0BAA0B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_version","_BridgeContextManager","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BridgeContextManager","constructor","Map","initializeSDKInfo","sdkBridgeInfo","react_native","sdkVersion","properties","set","JSON","stringify","getInstance","instance","appendBridgeContext","entries","forEach","key","error","console","warn","mergeWithLocalPropertiesSync","localProperties","merged","assign","bridgeContextManager","exports","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","NativeModules","FTMobileReactNative","NativeEventEmitter","sdkConfig","config","serverUrl","length","datakitUrl","sdk","bindRUMUserData","userId","userName","userEmail","extra","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","clearAllData","updateRemoteConfig","updateRemoteConfigWithMiniUpdateInterval","interval","rules","addRemoteConfigListener","listener","emitter","addListener"],"sources":["ft_mobile_agent.tsx"],"sourcesContent":["import { EmitterSubscription, NativeEventEmitter, NativeModules } from 'react-native';\nimport { version as sdkVersion } from './version';\n\n/**\n * Bridge context manager for managing shared properties across RUM and Logger modules\n * This class provides a centralized way to store and retrieve global properties that will be\n * automatically merged with local properties when making calls to RUM and Logger functions\n */\nclass BridgeContextManager {\n private static instance: BridgeContextManager;\n private properties: Map<string, any> = new Map();\n\n private constructor() {\n // Initialize with SDK version information\n this.initializeSDKInfo();\n }\n\n /**\n * Initialize SDK information properties\n * @private\n */\n private initializeSDKInfo(): void {\n // Create sdk_bridge_info with version information\n const sdkBridgeInfo = {\n react_native: sdkVersion,\n };\n\n // Set the sdk_bridge_info property\n this.properties.set('sdk_bridge_info', JSON.stringify(sdkBridgeInfo));\n }\n\n /**\n * Get singleton instance of BridgeContextManager\n * @returns BridgeContextManager instance\n */\n public static getInstance(): BridgeContextManager {\n if (!BridgeContextManager.instance) {\n BridgeContextManager.instance = new BridgeContextManager();\n }\n return BridgeContextManager.instance;\n }\n\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n public appendBridgeContext(properties: Record<string, any>): void {\n // Store properties locally in JavaScript\n try {\n // Store properties locally in JavaScript\n Object.entries(properties).forEach(([key, value]) => {\n this.properties.set(key, value);\n });\n } catch (error) {\n console.warn('Failed to append bridge context:', error);\n }\n }\n\n /**\n * Merge bridge context properties with local properties\n * Bridge context properties take precedence over local properties\n * @param localProperties Local properties to merge with bridge context properties\n * @returns Merged properties object\n */\n public mergeWithLocalPropertiesSync(localProperties?: object): Record<string, any> {\n try {\n const merged: Record<string, any> = {};\n\n // First add local properties (if any)\n if (localProperties) {\n Object.assign(merged, localProperties);\n }\n\n // Then add bridge context properties (these will override local properties with same keys)\n this.properties.forEach((value, key) => {\n merged[key] = value;\n });\n\n return merged;\n } catch (error) {\n console.warn(\n 'Failed to merge bridge context with local properties:',\n error\n );\n // Return empty object or only local properties on error\n return localProperties ? { ...localProperties } : {};\n }\n }\n}\n\n// Internal bridge context manager - not exported\nexport const bridgeContextManager = BridgeContextManager.getInstance();\n\n/**\n * Environment.\n */\nexport enum EnvType {\n prod, gray, pre, common, local\n};\nexport enum FTDBCacheDiscard { discard, discardOldest };\n\n/**\n * Remote config override rule matching condition for custom keys. Supports exact match and contains match.\n * For exact match, set the value directly, for example: \"userid\": \"test_user\", which means the rule will be applied when the custom key \"userid\" is exactly \"test_user\".\n * For contains match, set the value as an object with a \"contains\" field, for example: \"userid\": { \"contains\": \"test_user\" }, which means the rule will be applied when the custom key \"userid\" contains the object \"test_user\".\n*/\nexport type FTRemoteConfigCustomKeyContainsMatch = {\n contains: string | number | boolean;\n};\n\n/**\n * Matching rules for remote config override\n * Defines matching conditions using customKeys\n */\nexport type FTRemoteConfigOverrideMatch = {\n customKeys?: Record<string, string | number | boolean | FTRemoteConfigCustomKeyContainsMatch>;\n};\n\n/**\n * Values that can be modified by remote config override rules.\n * These values will adjust the fetched remote configuration before it is applied.\n*/\nexport type FTRemoteConfigOverrideValues = {\n env?: string;\n serviceName?: string;\n autoSync?: boolean;\n compressIntakeRequests?: boolean;\n syncPageSize?: number;\n syncSleepTime?: number;\n rumSampleRate?: number;\n rumSessionOnErrorSampleRate?: number;\n rumEnableTraceUserAction?: boolean;\n rumEnableTraceUserView?: boolean;\n rumEnableTraceUserResource?: boolean;\n rumEnableResourceHostIP?: boolean;\n rumEnableTrackAppUIBlock?: boolean;\n rumBlockDurationMs?: number;\n rumEnableTrackAppCrash?: boolean;\n rumEnableTrackAppANR?: boolean;\n rumEnableTraceWebView?: boolean;\n rumAllowWebViewHost?: Array<string>;\n traceSampleRate?: number;\n traceEnableAutoTrace?: boolean;\n traceType?: string;\n logSampleRate?: number;\n logLevelFilters?: Array<string>;\n logEnableCustomLog?: boolean;\n logEnableConsoleLog?: boolean;\n};\n\n/**\n * Remote config override rules .\n * Adjust the fetched remote configuration before application.\n*/\nexport type FTRemoteConfigOverrideRule = {\n id?: string,\n enabled?: boolean,\n match: FTRemoteConfigOverrideMatch,\n override: FTRemoteConfigOverrideValues,\n}\n/**\n * Final result of the remote config update\n * @param triggerType the type of remote config update trigger, auto or manual\n * @param success whether the remote config update was successful\n * @param platform the platform of the device, ios or android\n * @param timestamp the timestamp when the remote config update was triggered\n * @param rawJson the final remote config update result, in JSON string format\n * @param errorCode the error code if the remote config update failed, may be null if the update was successful\n * @param errorMessage the error message if the remote config update failed, may be null if the update was successful\n * @param appliedOverrideRuleIds the list of override rule IDs applied in this remote config update, may be null if no rules were applied\n */\nexport type FTRemoteConfigResult = {\n triggerType: 'auto' | 'manual';\n success: boolean;\n platform: 'ios' | 'android';\n timestamp: number;\n rawJson?: string;\n errorCode?: string | number;\n errorMessage?: string;\n appliedOverrideRuleIds?: string[];\n};\n/**\n * Configure SDK startup parameters.\n * @param serverUrl data reporting address, deprecated, use [datakitUrl] instead\n * @param datakitUrl datakit access URL address, example: http://10.0.0.1:9529, default port 9529. Choose one between datakit and dataway configuration\n * @param datawayUrl dataway access URL address, example: http://10.0.0.1:9528, default port 9528, note: the device installing the SDK needs to be able to access this address. Note: choose one between datakit and dataway configuration\n * @param clientToken dataway authentication token, needs to be configured together with [datawayUrl]\n * @param debug set whether to allow log printing, default false\n * @param env environment, default prod\n * @param service set the name of the business or service it belongs to, default: `df_rum_ios`, `df_rum_android`\n * @param autoSync whether data is automatically synchronized and uploaded, default: true\n * @param syncPageSize number of synchronized items per request during data synchronization, minimum value 5, default: 10\n * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100\n * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default\n * @param compressIntakeRequests whether to compress synchronized data\n * @param globalContext custom global parameters\n * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension\n * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect\n * @param dbCacheLimit db cache limit size, minimum value 30MB, default 100MB, unit byte\n * @param dbDiscardStrategy db data discard strategy\n * @param dataModifier data modifier, modify individual fields {key:value}, after setting, the SDK will replace the original value with the set value according to the key\n * @param lineDataModifier data modifier, modify single data {\"measurement\":measurement,\"data\":{key:value}}, after setting, the SDK will replace the original value with the set value according to the key\n * @param remoteConfiguration Set whether to enable remote dynamic configuration\n * @param remoteConfigMiniUpdateInterval Set remote dynamic configuration minimum update interval, unit seconds, default 12*60*60\n * @param remoteConfigOverrideRules Remote config override rules .Adjust the fetched remote configuration before application.\n*/\n export interface FTMobileConfig {\n /**\n * @deprecated \"serverUrl\" parameter renamed to \"datakitUrl\"\n */\n serverUrl?: string,\n datakitUrl?: string,\n datawayUrl?: string,\n clientToken?: string,\n debug?:boolean,\n envType?:EnvType,\n env?:string,\n service?:string,\n autoSync?:boolean,\n syncPageSize?:number,\n syncSleepTime?:number,\n enableDataIntegerCompatible?:boolean,\n compressIntakeRequests?:boolean,\n globalContext?:object,\n groupIdentifiers?:Array<string>,\n enableLimitWithDbSize?:boolean,\n dbCacheLimit?:number,\n dbDiscardStrategy?:FTDBCacheDiscard,\n dataModifier?:object,\n lineDataModifier?:object,\n remoteConfiguration?:boolean,\n remoteConfigMiniUpdateInterval?:number,\n remoteConfigOverrideRules?:Array<FTRemoteConfigOverrideRule>,\n }\n\ntype FTMobileReactNativeType = {\n\n /**\n * SDK initialization method.\n * @param config SDK initialization configuration items.\n * @returns a Promise.\n */\n sdkConfig(config:FTMobileConfig): Promise<void>;\n /**\n * Bind user.\n * @param userId user ID.\n * @param userName user name.\n * @param userEmail user email\n * @param extra additional user information\n * @returns a Promise.\n */\n bindRUMUserData(userId: string,userName?:string,userEmail?:string,extra?:object): Promise<void>;\n /**\n * Unbind user.\n * @returns a Promise.\n */\n unbindRUMUserData(): Promise<void>;\n /**\n * Add custom global parameters. Applies to RUM and Log data\n * @param context custom global parameters.\n * @returns a Promise.\n */\n appendGlobalContext(context:object):Promise<void>;\n /**\n * Add custom RUM global parameters. Applies to RUM data\n * @param context custom RUM global parameters.\n * @returns a Promise.\n */\n appendRUMGlobalContext(context:object):Promise<void>;\n /**\n * Add custom RUM and Log global parameters. Applies to Log data\n * @param context custom Log global parameters.\n * @returns a Promise.\n */\n appendLogGlobalContext(context:object):Promise<void>;\n /**\n * Actively synchronize data. When `FTMobileConfig.autoSync=false` is configured, you need to actively trigger this method to synchronize data.\n * @returns a Promise.\n */\n flushSyncData():Promise<void>;\n\n /**\n * Synchronize events in iOS Widget Extension, iOS only\n * @param groupIdentifier app groupId\n * @returns {groupIdentifier:string,datas:Array<object>} can be used to view data collected in Extension.\n */\n trackEventFromExtension(identifier:string): Promise<object>\n /**\n * Shut down objects currently running in the SDK\n */\n shutDown():Promise<void>\n /**\n * Clear all data that has not yet been uploaded to the server.\n */\n clearAllData():Promise<void>\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n appendBridgeContext(properties: Record<string, any>): void;\n /**\n * Update remote configuration, after enabling remote configuration, you can call this method to update the configuration in real time.\n */\n updateRemoteConfig():Promise<FTRemoteConfigResult>\n /**\n * Update remote configuration with minimum update interval, after enabling remote configuration, you can call this method to update the configuration in real time.\n * This method is used to set the minimum update interval for remote configuration updates. If the time since the last update is less than the specified interval, the update will not be performed.\n * @param interval minimum update interval, unit seconds\n * @param rules Remote config override rules .Adjust the fetched remote configuration before application. \n * @returns the result of the remote config update\n */\n updateRemoteConfigWithMiniUpdateInterval(interval:number,rules?: Array<FTRemoteConfigOverrideRule>):Promise<FTRemoteConfigResult>\n /**\n * Listen for auto remote configuration updates triggered by the native SDK.\n * Manual updates are returned through the update Promise instead of this event.\n */\n addRemoteConfigListener(listener:(result:FTRemoteConfigResult)=>void): EmitterSubscription\n };\n\n class FTMobileReactNativeWrapper implements FTMobileReactNativeType {\n private sdk:FTMobileReactNativeType = NativeModules.FTMobileReactNative;\n private emitter = new NativeEventEmitter(NativeModules.FTMobileReactNative);\n\n sdkConfig(config:FTMobileConfig): Promise<void> {\n if(config.serverUrl != null && config.serverUrl.length>0 && config.datakitUrl == null){\n config.datakitUrl = config.serverUrl;\n }\n return this.sdk.sdkConfig(config);\n }\n bindRUMUserData(userId: string,userName?:string,userEmail?:string,extra?:object): Promise<void> {\n return this.sdk.bindRUMUserData(userId,userName,userEmail,extra);\n }\n unbindRUMUserData(): Promise<void> {\n return this.sdk.unbindRUMUserData();\n }\n appendGlobalContext(context: object): Promise<void> {\n return this.sdk.appendGlobalContext(context);\n }\n appendLogGlobalContext(context: object): Promise<void> {\n return this.sdk.appendLogGlobalContext(context);\n }\n appendRUMGlobalContext(context: object): Promise<void> {\n return this.sdk.appendRUMGlobalContext(context);\n }\n trackEventFromExtension(identifier:string) :Promise<object>{\n return this.sdk.trackEventFromExtension(identifier);\n }\n flushSyncData():Promise<void>{\n return this.sdk.flushSyncData();\n }\n shutDown():Promise<void>{\n return this.sdk.shutDown();\n }\n clearAllData():Promise<void>{\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Use bridgeContextManager to store properties in JavaScript and send to native SDK\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig():Promise<FTRemoteConfigResult>{\n return this.sdk.updateRemoteConfig();\n }\n updateRemoteConfigWithMiniUpdateInterval(interval:number,rules?: Array<FTRemoteConfigOverrideRule>):Promise<FTRemoteConfigResult>{\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval,rules);\n }\n addRemoteConfigListener(listener:(result:FTRemoteConfigResult)=>void): EmitterSubscription {\n return this.emitter.addListener('ft_remote_config_callback', listener);\n }\n }\nexport const FTMobileReactNative: FTMobileReactNativeType = new FTMobileReactNativeWrapper();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAkD,IAAAE,qBAAA;AAAA,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,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AAmB,CAACC,OAAO,CAAC;EAC7C;EACAC,sBAAsBA,CAACD,OAAe,EAAiB;IACnD,OAAO,IAAI,CAACR,GAAG,CAACS,sBAAsB,CAACD,OAAO,CAAC;EACnD;EACAE,sBAAsBA,CAACF,OAAe,EAAiB;IACnD,OAAO,IAAI,CAACR,GAAG,CAACU,sBAAsB,CAACF,OAAO,CAAC;EACnD;EACAG,uBAAuBA,CAACC,UAAiB,EAAkB;IACzD,OAAO,IAAI,CAACZ,GAAG,CAACW,uBAAuB,CAACC,UAAU,CAAC;EACrD;EACAC,aAAaA,CAAA,EAAgB;IAC5B,OAAO,IAAI,CAACb,GAAG,CAACa,aAAa,CAAC,CAAC;EAChC;EACAC,QAAQA,CAAA,EAAgB;IACvB,OAAO,IAAI,CAACd,GAAG,CAACc,QAAQ,CAAC,CAAC;EAC3B;EACAC,YAAYA,CAAA,EAAgB;IAC3B,OAAO,IAAI,CAACf,GAAG,CAACe,YAAY,CAAC,CAAC;EAC/B;EACAvC,mBAAmBA,CAACN,UAA+B,EAAQ;IACzD;IACDiB,oBAAoB,CAACX,mBAAmB,CAACN,UAAU,CAAC;EACtD;EACC8C,kBAAkBA,CAAA,EAAgC;IACjD,OAAO,IAAI,CAAChB,GAAG,CAACgB,kBAAkB,CAAC,CAAC;EACrC;EACAC,wCAAwCA,CAACC,QAAe,EAACC,KAAyC,EAA+B;IAC9H,OAAO,IAAI,CAACnB,GAAG,CAACiB,wCAAwC,CAACC,QAAQ,EAACC,KAAK,CAAC;EAC3E;EACAC,uBAAuBA,CAACC,QAA4C,EAAuB;IACzF,OAAO,IAAI,CAACC,OAAO,CAACC,WAAW,CAAC,2BAA2B,EAAEF,QAAQ,CAAC;EACxE;AACF;AACM,MAAM5B,mBAA4C,GAAAL,OAAA,CAAAK,mBAAA,GAAG,IAAIF,0BAA0B,CAAC,CAAC","ignoreList":[]}
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.FTReactNativeRUM = exports.FTRUMCacheDiscard = exports.ErrorMonitorType = exports.DeviceMetricsMonitorType = exports.DetectFrequency = void 0;
6
+ exports.IOSCrashMonitoringType = exports.FTReactNativeRUM = exports.FTRUMCacheDiscard = exports.ErrorMonitorType = exports.DeviceMetricsMonitorType = exports.DetectFrequency = void 0;
7
7
  var _reactNative = require("react-native");
8
8
  var _FTRumErrorTracking = require("./rum/FTRumErrorTracking");
9
9
  var _FTRumActionTracking = require("./rum/FTRumActionTracking");
10
+ var _ft_mobile_agent = require("./ft_mobile_agent");
10
11
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
13
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -45,8 +46,17 @@ let FTRUMCacheDiscard = exports.FTRUMCacheDiscard = /*#__PURE__*/function (FTRUM
45
46
  FTRUMCacheDiscard[FTRUMCacheDiscard["discardOldest"] = 1] = "discardOldest";
46
47
  return FTRUMCacheDiscard;
47
48
  }({});
48
- ;
49
-
49
+ let IOSCrashMonitoringType = exports.IOSCrashMonitoringType = /*#__PURE__*/function (IOSCrashMonitoringType) {
50
+ IOSCrashMonitoringType[IOSCrashMonitoringType["machException"] = 1] = "machException";
51
+ IOSCrashMonitoringType[IOSCrashMonitoringType["signal"] = 2] = "signal";
52
+ IOSCrashMonitoringType[IOSCrashMonitoringType["cppException"] = 4] = "cppException";
53
+ IOSCrashMonitoringType[IOSCrashMonitoringType["nsException"] = 8] = "nsException";
54
+ IOSCrashMonitoringType[IOSCrashMonitoringType["system"] = 64] = "system";
55
+ IOSCrashMonitoringType[IOSCrashMonitoringType["applicationState"] = 128] = "applicationState";
56
+ IOSCrashMonitoringType[IOSCrashMonitoringType["all"] = 207] = "all";
57
+ IOSCrashMonitoringType[IOSCrashMonitoringType["highCompatibility"] = 206] = "highCompatibility";
58
+ return IOSCrashMonitoringType;
59
+ }({});
50
60
  /**
51
61
  * Set RUM tracking conditions.
52
62
  * @param androidAppId appId, apply during monitoring
@@ -69,8 +79,10 @@ let FTRUMCacheDiscard = exports.FTRUMCacheDiscard = /*#__PURE__*/function (FTRUM
69
79
  * @param globalContext custom global parameters
70
80
  * @param rumCacheLimitCount RUM max cache size, default 100_000
71
81
  * @param rumDiscardStrategy RUM data discard strategy
82
+ * @param enableTraceWebView Set whether to enable WebView data collection, default true
83
+ * @param allowWebViewHost Set specific hosts or domains allowed to collect WebView data, nil means collect all
84
+ * @param iosCrashMonitoringType iOS crash monitoring type , default is highCompatibility, which does not include Mach exceptions for better compatibility. you must enable system crash monitoring to get crash stack traces and crash information.
72
85
  */
73
-
74
86
  /**
75
87
  * RUM Resource data.
76
88
  * @param url request URL
@@ -80,7 +92,6 @@ let FTRUMCacheDiscard = exports.FTRUMCacheDiscard = /*#__PURE__*/function (FTRUM
80
92
  * @param responseBody response content
81
93
  * @param resourceStatus response status code
82
94
  */
83
-
84
95
  ;
85
96
  /**
86
97
  * RUM Resource performance metrics.
@@ -109,31 +120,47 @@ class FTReactNativeRUMWrapper {
109
120
  return this.rum.setConfig(config);
110
121
  }
111
122
  startAction(actionName, actionType, property) {
112
- return this.rum.startAction(actionName, actionType, property);
123
+ // Automatically merge bridge context properties with local properties
124
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
125
+ return this.rum.startAction(actionName, actionType, mergedProperties);
113
126
  }
114
127
  addAction(actionName, actionType, property) {
115
- return this.rum.addAction(actionName, actionType, property);
128
+ // Automatically merge bridge context properties with local properties
129
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
130
+ return this.rum.addAction(actionName, actionType, mergedProperties);
116
131
  }
117
132
  onCreateView(viewName, loadTime) {
118
133
  return this.rum.onCreateView(viewName, loadTime);
119
134
  }
120
135
  startView(viewName, property) {
121
- return this.rum.startView(viewName, property);
136
+ // Automatically merge bridge context properties with local properties
137
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
138
+ return this.rum.startView(viewName, mergedProperties);
122
139
  }
123
140
  stopView(property) {
124
- return this.rum.stopView(property);
141
+ // Automatically merge bridge context properties with local properties
142
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
143
+ return this.rum.stopView(mergedProperties);
125
144
  }
126
145
  addError(stack, message, property) {
127
- return this.rum.addError(stack, message, property);
146
+ // Automatically merge bridge context properties with local properties
147
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
148
+ return this.rum.addError(stack, message, mergedProperties);
128
149
  }
129
150
  addErrorWithType(type, stack, message, property) {
130
- return this.rum.addErrorWithType(type, stack, message, property);
151
+ // Automatically merge bridge context properties with local properties
152
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
153
+ return this.rum.addErrorWithType(type, stack, message, mergedProperties);
131
154
  }
132
155
  startResource(key, property) {
133
- return this.rum.startResource(key, property);
156
+ // Automatically merge bridge context properties with local properties
157
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
158
+ return this.rum.startResource(key, mergedProperties);
134
159
  }
135
160
  stopResource(key, property) {
136
- return this.rum.stopResource(key, property);
161
+ // Automatically merge bridge context properties with local properties
162
+ const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);
163
+ return this.rum.stopResource(key, mergedProperties);
137
164
  }
138
165
  addResource(key, resource, metrics = {}) {
139
166
  return this.rum.addResource(key, resource, metrics);
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_FTRumErrorTracking","_FTRumActionTracking","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ErrorMonitorType","exports","DeviceMetricsMonitorType","DetectFrequency","FTRUMCacheDiscard","FTReactNativeRUMWrapper","constructor","NativeModules","FTReactNativeRUM","setConfig","config","console","log","enableAutoTrackError","FTRumErrorTracking","startTracking","enableAutoTrackUserAction","FTRumActionTracking","rum","startAction","actionName","actionType","property","addAction","onCreateView","viewName","loadTime","startView","stopView","addError","stack","message","addErrorWithType","type","startResource","key","stopResource","addResource","resource","metrics"],"sources":["ft_rum.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { FTRumErrorTracking} from './rum/FTRumErrorTracking';\nimport { FTRumActionTracking} from './rum/FTRumActionTracking';\n\n/**\n * Error monitoring type.\n */\n export enum ErrorMonitorType {\n all=0xFFFFFFFF,\n battery=1 << 1,\n memory=1 << 2,\n cpu=1 << 3,\n }\n /**\n * Page monitoring supplement type\n */\n export enum DeviceMetricsMonitorType {\n all=0xFFFFFFFF,\n battery=1 << 1,\n memory=1 << 2,\n cpu=1 << 3,\n fps=1 << 4\n }\n /**\n * Device information monitoring cycle.\n */\n export enum DetectFrequency { normal, frequent, rare }\n\n export enum FTRUMCacheDiscard { discard, discardOldest };\n\n/**\n * Set RUM tracking conditions.\n * @param androidAppId appId, apply during monitoring\n * @param iOSAppId appId, apply during monitoring\n * @param sampleRate sampling rate\n * @param sessionOnErrorSampleRate error session sampling rate. For sessions not sampled, if ERROR is hit, collect data 1 minute before the error occurs\n * @param enableAutoTrackUserAction whether to automatically collect react-native control click events, can set actionName with accessibilityLabel when enabled\n * @param enableTrackError whether to automatically collect react-native Error\n * @param enableTrackNativeCrash whether to collect Native Error\n * @param enableTrackNativeAppANR whether to collect Native ANR\n * @param enableTrackNativeFreeze whether to collect Native Freeze\n * @param nativeFreezeDurationMs set the threshold for collecting Native Freeze, value range [100,), unit ms. iOS default 250ms, Android default 1000ms\n * @param enableNativeUserAction whether to start Native Action tracking, Button click events, recommended to disable for pure react-native apps\n * @param enableNativeUserView whether to start Native View auto tracking, recommended to disable for pure react-native apps\n * @param enableNativeUserResource whether to automatically collect react-native Resource\n * @param enableResourceHostIP whether to collect network request Host IP (only for native http, iOS 13 and above)\n * @param errorMonitorType error monitoring supplement type\n * @param deviceMonitorType page monitoring supplement type\n * @param detectFrequency monitoring frequency\n * @param globalContext custom global parameters\n * @param rumCacheLimitCount RUM max cache size, default 100_000\n * @param rumDiscardStrategy RUM data discard strategy\n */\n export interface FTRUMConfig{\n androidAppId:string,\n iOSAppId:string,\n sampleRate?:number,\n sessionOnErrorSampleRate?:number,\n enableAutoTrackUserAction?:boolean,\n enableAutoTrackError?:boolean,\n enableTrackNativeCrash?:boolean,\n enableTrackNativeAppANR?:boolean,\n enableTrackNativeFreeze?:boolean,\n nativeFreezeDurationMs?:number,\n enableNativeUserAction?:boolean,\n enableNativeUserView?:boolean,\n enableNativeUserResource?:boolean,\n enableResourceHostIP?:boolean,\n errorMonitorType?:ErrorMonitorType,\n deviceMonitorType?:DeviceMetricsMonitorType,\n detectFrequency?:DetectFrequency\n globalContext?:object,\n rumCacheLimitCount?:number,\n rumDiscardStrategy?:FTRUMCacheDiscard,\n }\n/**\n * RUM Resource data.\n * @param url request URL\n * @param httpMethod request method\n * @param requestHeader request header parameters\n * @param responseHeader response header parameters\n * @param responseBody response content\n * @param resourceStatus response status code\n */\n export interface FTRUMResource{\n url:string,\n httpMethod:string,\n requestHeader:object,\n responseHeader?:object,\n responseBody?:string,\n resourceStatus?:number\n };\n/**\n * RUM Resource performance metrics.\n * @param duration resource load time\n * @param resource_dns resource DNS resolution time\n * @param resource_tcp resource TCP connection time\n * @param resource_ssl resource SSL connection time\n * @param resource_ttfb resource request response time\n * @param resource_trans resource content transfer time\n * @param resource_first_byte resource first byte time\n */\n export interface FTRUMResourceMetrics{\n\n duration?:number,\n resource_dns?:number,\n resource_tcp?:number,\n resource_ssl?:number,\n resource_ttfb?:number,\n resource_trans?:number,\n resource_first_byte?:number,\n };\n type FTReactNativeRUMType = {\n /**\n * Set RUM tracking conditions and enable RUM collection.\n * @param config rum configuration parameters.\n * @returns a Promise.\n */\n setConfig(config:FTRUMConfig): Promise<void>;\n /**\n * Start RUM Action.\n * RUM will bind Resource, Error, LongTask events that may be triggered by this Action.\n * Avoid adding multiple times within 0.1s, only one Action will be associated with the same View at the same time, and new Actions will be discarded if the previous one has not ended.\n * Adding Action with `addAction` method does not affect each other.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n startAction(actionName:string,actionType:string,property?:object): Promise<void>;\n /**\n * Add Action event. This type of data cannot be associated with Error, Resource, LongTask data, and has no discard logic.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n addAction(actionName:string,actionType:string,property?:object): Promise<void>;\n /**\n * view load duration.\n * @param viewName view name\n * @param loadTime view load duration\n * @returns a Promise.\n */\n onCreateView(viewName:string,loadTime:number): Promise<void>;\n /**\n * view start.\n * @param viewName page name\n * @param property event context (optional)\n * @returns a Promise.\n */\n startView(viewName: string, property?: object): Promise<void>;\n /**\n * view end.\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopView(property?:object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addError(stack: string, message: string,property?:object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param type error type\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addErrorWithType(type:string,stack: string, message: string,property?:object): Promise<void>;\n /**\n * Start resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n startResource(key: string,property?:object): Promise<void>;\n /**\n * End resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopResource(key: string,property?:object): Promise<void>;\n /**\n * Send resource data metrics.\n * @param key unique id\n * @param resource resource data\n * @param metrics resource performance data\n * @returns a Promise.\n */\n addResource(key:string, resource:FTRUMResource,metrics?:FTRUMResourceMetrics):Promise<void>;\n }\n\n class FTReactNativeRUMWrapper implements FTReactNativeRUMType {\n private rum: FTReactNativeRUMType = NativeModules.FTReactNativeRUM;\n\n\n setConfig(config:FTRUMConfig): Promise<void>{\n console.log('FTRUMConfig');\n if(config.enableAutoTrackError){\n FTRumErrorTracking.startTracking();\n }\n if(config.enableAutoTrackUserAction){\n FTRumActionTracking.startTracking();\n }\n return this.rum.setConfig(config);\n }\n startAction(actionName:string,actionType:string,property?:object): Promise<void>{\n return this.rum.startAction(actionName,actionType,property);\n }\n addAction(actionName: string, actionType: string, property?: object): Promise<void> {\n return this.rum.addAction(actionName,actionType,property);\n }\n onCreateView(viewName:string,loadTime:number): Promise<void>{\n return this.rum.onCreateView(viewName,loadTime);\n }\n startView(viewName: string, property?:object): Promise<void>{\n return this.rum.startView(viewName,property);\n }\n stopView(property?:object): Promise<void>{\n return this.rum.stopView(property);\n }\n addError(stack: string, message: string,property?:object): Promise<void>{\n return this.rum.addError(stack,message,property);\n }\n addErrorWithType(type:string,stack: string, message: string,property?:object): Promise<void>{\n return this.rum.addErrorWithType(type,stack,message,property);\n }\n startResource(key: string,property?:object): Promise<void>{\n return this.rum.startResource(key,property);\n }\n stopResource(key: string,property?:object): Promise<void>{\n return this.rum.stopResource(key,property);\n }\n addResource(key:string, resource:FTRUMResource,metrics:FTRUMResourceMetrics={}):Promise<void>{\n return this.rum.addResource(key,resource,metrics);\n }\n }\n\n export const FTReactNativeRUM: FTReactNativeRUMType = new FTReactNativeRUMWrapper();\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAA+D,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,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3,"names":["_reactNative","require","_FTRumErrorTracking","_FTRumActionTracking","_ft_mobile_agent","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ErrorMonitorType","exports","DeviceMetricsMonitorType","DetectFrequency","FTRUMCacheDiscard","IOSCrashMonitoringType","FTReactNativeRUMWrapper","constructor","NativeModules","FTReactNativeRUM","setConfig","config","console","log","enableAutoTrackError","FTRumErrorTracking","startTracking","enableAutoTrackUserAction","FTRumActionTracking","rum","startAction","actionName","actionType","property","mergedProperties","bridgeContextManager","mergeWithLocalPropertiesSync","addAction","onCreateView","viewName","loadTime","startView","stopView","addError","stack","message","addErrorWithType","type","startResource","key","stopResource","addResource","resource","metrics"],"sources":["ft_rum.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { FTRumErrorTracking} from './rum/FTRumErrorTracking';\nimport { FTRumActionTracking} from './rum/FTRumActionTracking';\nimport { bridgeContextManager } from './ft_mobile_agent';\n\n/**\n * Error monitoring type.\n */\n export enum ErrorMonitorType {\n all=0xFFFFFFFF,\n battery=1 << 1,\n memory=1 << 2,\n cpu=1 << 3,\n }\n /**\n * Page monitoring supplement type\n */\n export enum DeviceMetricsMonitorType {\n all=0xFFFFFFFF,\n battery=1 << 1,\n memory=1 << 2,\n cpu=1 << 3,\n fps=1 << 4\n }\n /**\n * Device information monitoring cycle.\n */\n export enum DetectFrequency { normal, frequent, rare }\n\nexport enum FTRUMCacheDiscard {\n discard,\n discardOldest,\n}\n\nexport enum IOSCrashMonitoringType {\n /** Monitor Mach kernel exceptions. */\n machException = 0x01,\n\n /** Monitor fatal signals. */\n signal = 0x02,\n\n /** Monitor uncaught C++ exceptions. */\n cppException = 0x04,\n\n /** Monitor uncaught Objective-C NSExceptions. */\n nsException = 0x08,\n\n /** Track and inject system information. */\n system = 0x40,\n\n /** Track and inject application state information. */\n applicationState = 0x80,\n\n /** All crash monitor types. */\n all = machException |\n signal |\n cppException |\n nsException |\n applicationState |\n system,\n\n /** High compatibility crash monitor types (excludes Mach exceptions). */\n highCompatibility = all & ~machException,\n}\n\n/**\n * Set RUM tracking conditions.\n * @param androidAppId appId, apply during monitoring\n * @param iOSAppId appId, apply during monitoring\n * @param sampleRate sampling rate\n * @param sessionOnErrorSampleRate error session sampling rate. For sessions not sampled, if ERROR is hit, collect data 1 minute before the error occurs\n * @param enableAutoTrackUserAction whether to automatically collect react-native control click events, can set actionName with accessibilityLabel when enabled\n * @param enableTrackError whether to automatically collect react-native Error\n * @param enableTrackNativeCrash whether to collect Native Error\n * @param enableTrackNativeAppANR whether to collect Native ANR\n * @param enableTrackNativeFreeze whether to collect Native Freeze\n * @param nativeFreezeDurationMs set the threshold for collecting Native Freeze, value range [100,), unit ms. iOS default 250ms, Android default 1000ms\n * @param enableNativeUserAction whether to start Native Action tracking, Button click events, recommended to disable for pure react-native apps\n * @param enableNativeUserView whether to start Native View auto tracking, recommended to disable for pure react-native apps\n * @param enableNativeUserResource whether to automatically collect react-native Resource\n * @param enableResourceHostIP whether to collect network request Host IP (only for native http, iOS 13 and above)\n * @param errorMonitorType error monitoring supplement type\n * @param deviceMonitorType page monitoring supplement type\n * @param detectFrequency monitoring frequency\n * @param globalContext custom global parameters\n * @param rumCacheLimitCount RUM max cache size, default 100_000\n * @param rumDiscardStrategy RUM data discard strategy\n * @param enableTraceWebView Set whether to enable WebView data collection, default true\n * @param allowWebViewHost Set specific hosts or domains allowed to collect WebView data, nil means collect all\n * @param iosCrashMonitoringType iOS crash monitoring type , default is highCompatibility, which does not include Mach exceptions for better compatibility. you must enable system crash monitoring to get crash stack traces and crash information. \n */\n export interface FTRUMConfig{\n androidAppId:string,\n iOSAppId:string,\n sampleRate?:number,\n sessionOnErrorSampleRate?:number,\n enableAutoTrackUserAction?:boolean,\n enableAutoTrackError?:boolean,\n enableTrackNativeCrash?:boolean,\n enableTrackNativeAppANR?:boolean,\n enableTrackNativeFreeze?:boolean,\n nativeFreezeDurationMs?:number,\n enableNativeUserAction?:boolean,\n enableNativeUserView?:boolean,\n enableNativeUserResource?:boolean,\n enableResourceHostIP?:boolean,\n errorMonitorType?:ErrorMonitorType,\n deviceMonitorType?:DeviceMetricsMonitorType,\n detectFrequency?:DetectFrequency\n globalContext?:object,\n rumCacheLimitCount?:number,\n rumDiscardStrategy?:FTRUMCacheDiscard,\n enableTraceWebView?: boolean,\n allowWebViewHost?: Array<string>,\n iosCrashMonitoringType?: IOSCrashMonitoringType,\n }\n/**\n * RUM Resource data.\n * @param url request URL\n * @param httpMethod request method\n * @param requestHeader request header parameters\n * @param responseHeader response header parameters\n * @param responseBody response content\n * @param resourceStatus response status code\n */\n export interface FTRUMResource{\n url:string,\n httpMethod:string,\n requestHeader:object,\n responseHeader?:object,\n responseBody?:string,\n resourceStatus?:number\n };\n/**\n * RUM Resource performance metrics.\n * @param duration resource load time\n * @param resource_dns resource DNS resolution time\n * @param resource_tcp resource TCP connection time\n * @param resource_ssl resource SSL connection time\n * @param resource_ttfb resource request response time\n * @param resource_trans resource content transfer time\n * @param resource_first_byte resource first byte time\n */\n export interface FTRUMResourceMetrics{\n\n duration?:number,\n resource_dns?:number,\n resource_tcp?:number,\n resource_ssl?:number,\n resource_ttfb?:number,\n resource_trans?:number,\n resource_first_byte?:number,\n };\n type FTReactNativeRUMType = {\n /**\n * Set RUM tracking conditions and enable RUM collection.\n * @param config rum configuration parameters.\n * @returns a Promise.\n */\n setConfig(config:FTRUMConfig): Promise<void>;\n /**\n * Start RUM Action.\n * RUM will bind Resource, Error, LongTask events that may be triggered by this Action.\n * Avoid adding multiple times within 0.1s, only one Action will be associated with the same View at the same time, and new Actions will be discarded if the previous one has not ended.\n * Adding Action with `addAction` method does not affect each other.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n startAction(actionName:string,actionType:string,property?:object): Promise<void>;\n /**\n * Add Action event. This type of data cannot be associated with Error, Resource, LongTask data, and has no discard logic.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n addAction(actionName:string,actionType:string,property?:object): Promise<void>;\n /**\n * view load duration.\n * @param viewName view name\n * @param loadTime view load duration\n * @returns a Promise.\n */\n onCreateView(viewName:string,loadTime:number): Promise<void>;\n /**\n * view start.\n * @param viewName page name\n * @param property event context (optional)\n * @returns a Promise.\n */\n startView(viewName: string, property?: object): Promise<void>;\n /**\n * view end.\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopView(property?:object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addError(stack: string, message: string,property?:object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param type error type\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addErrorWithType(type:string,stack: string, message: string,property?:object): Promise<void>;\n /**\n * Start resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n startResource(key: string,property?:object): Promise<void>;\n /**\n * End resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopResource(key: string,property?:object): Promise<void>;\n /**\n * Send resource data metrics.\n * @param key unique id\n * @param resource resource data\n * @param metrics resource performance data\n * @returns a Promise.\n */\n addResource(key:string, resource:FTRUMResource,metrics?:FTRUMResourceMetrics):Promise<void>;\n }\n\n class FTReactNativeRUMWrapper implements FTReactNativeRUMType {\n private rum: FTReactNativeRUMType = NativeModules.FTReactNativeRUM;\n\n\n setConfig(config:FTRUMConfig): Promise<void>{\n console.log('FTRUMConfig');\n if(config.enableAutoTrackError){\n FTRumErrorTracking.startTracking();\n }\n if(config.enableAutoTrackUserAction){\n FTRumActionTracking.startTracking();\n }\n return this.rum.setConfig(config);\n }\n startAction(actionName:string,actionType:string,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.startAction(actionName,actionType,mergedProperties);\n }\n addAction(actionName: string, actionType: string, property?: object): Promise<void> {\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.addAction(actionName,actionType,mergedProperties);\n }\n onCreateView(viewName:string,loadTime:number): Promise<void>{\n return this.rum.onCreateView(viewName,loadTime);\n }\n startView(viewName: string, property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.startView(viewName,mergedProperties);\n }\n stopView(property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.stopView(mergedProperties);\n }\n addError(stack: string, message: string,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.addError(stack,message,mergedProperties);\n }\n addErrorWithType(type:string,stack: string, message: string,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.addErrorWithType(type,stack,message,mergedProperties);\n }\n startResource(key: string,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.startResource(key,mergedProperties);\n }\n stopResource(key: string,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n return this.rum.stopResource(key,mergedProperties);\n }\n addResource(key:string, resource:FTRUMResource,metrics:FTRUMResourceMetrics={}):Promise<void>{\n return this.rum.addResource(key,resource,metrics);\n }\n }\n\n export const FTReactNativeRUM: FTReactNativeRUMType = new FTReactNativeRUMWrapper();\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GA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AgB,GAAGC,qCAAoB,CAACC,4BAA4B,CAACH,QAAQ,CAAC;IACpF,OAAO,IAAI,CAACJ,GAAG,CAACc,QAAQ,CAACC,KAAK,EAACC,OAAO,EAACX,gBAAgB,CAAC;EAC1D;EACAY,gBAAgBA,CAACC,IAAW,EAACH,KAAa,EAAEC,OAAe,EAACZ,QAAgB,EAAgB;IAC3F;IACA,MAAMC,gBAAgB,GAAGC,qCAAoB,CAACC,4BAA4B,CAACH,QAAQ,CAAC;IACpF,OAAO,IAAI,CAACJ,GAAG,CAACiB,gBAAgB,CAACC,IAAI,EAACH,KAAK,EAACC,OAAO,EAACX,gBAAgB,CAAC;EACvE;EACCc,aAAaA,CAACC,GAAW,EAAChB,QAAgB,EAAgB;IACxD;IACA,MAAMC,gBAAgB,GAAGC,qCAAoB,CAACC,4BAA4B,CAACH,QAAQ,CAAC;IACpF,OAAO,IAAI,CAACJ,GAAG,CAACmB,aAAa,CAACC,GAAG,EAACf,gBAAgB,CAAC;EACrD;EACAgB,YAAYA,CAACD,GAAW,EAAChB,QAAgB,EAAgB;IACvD;IACA,MAAMC,gBAAgB,GAAGC,qCAAoB,CAACC,4BAA4B,CAACH,QAAQ,CAAC;IACpF,OAAO,IAAI,CAACJ,GAAG,CAACqB,YAAY,CAACD,GAAG,EAACf,gBAAgB,CAAC;EACpD;EACAiB,WAAWA,CAACF,GAAU,EAAEG,QAAsB,EAACC,OAA4B,GAAC,CAAC,CAAC,EAAe;IAC3F,OAAO,IAAI,CAACxB,GAAG,CAACsB,WAAW,CAACF,GAAG,EAACG,QAAQ,EAACC,OAAO,CAAC;EACnD;AACF;AAEO,MAAMlC,gBAAsC,GAAAR,OAAA,CAAAQ,gBAAA,GAAG,IAAIH,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TraceType","exports","FTReactNativeTraceWrapper","constructor","NativeModules","FTReactNativeTrace","setConfig","config","trace","getTraceHeader","key","url","getTraceHeaderFields"],"sources":["ft_tracing.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n//FTReactNativeTrace\n\n/**\n * Trace types for use.\n */\n export enum TraceType {\n ddTrace,\n zipkinMulti,\n zipkinSingle,\n traceparent,\n skywalking,\n jaeger,\n };\n/**\n * Configure trace.\n * @param sampleRate sampling rate\n * @param traceType trace type\n * @param enableLinkRUMData whether to link with RUM data\n * @param enableNativeAutoTrace whether to enable automatic tracing\n */\n export interface FTTraceConfig{\n sampleRate?:number,\n traceType?:TraceType,\n enableLinkRUMData?:boolean,\n enableNativeAutoTrace?:boolean,\n };\n\n type FTReactNativeTraceType = {\n /**\n * Configure trace to enable distributed tracing.\n * @param config trace configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: FTTraceConfig): Promise<void>; \n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n * @deprecated use getTraceHeaderFields() replace.\n */\n getTraceHeader(key:String, url: String): Promise<object>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n */\n getTraceHeaderFields(url: String,key?:String): Promise<object>;\n };\n\n class FTReactNativeTraceWrapper implements FTReactNativeTraceType {\n private trace: FTReactNativeTraceType = NativeModules.FTReactNativeTrace;\n\n\n setConfig(config:FTTraceConfig): Promise<void>{\n return this.trace.setConfig(config);\n }\n /**\n * Get trace HTTP request header data.\n * @param key unique id\n * @param url request URL\n * @returns a Promise.\n */\n getTraceHeader(key:String, url: String): Promise<object>{\n return this.trace.getTraceHeaderFields(url,key);\n }\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @param key unique id\n * @returns a Promise.\n */\n getTraceHeaderFields(url: String,key?:String): Promise<object>{\n return this.trace.getTraceHeaderFields(url,key);\n }\n\n }\n export const FTReactNativeTrace:FTReactNativeTraceType = new FTReactNativeTraceWrapper(); \n\n"],"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;EACrC;EACD;AACF;AACA;AACA;AACA;AACA;EACGE,cAAcA,CAACC,GAAU,EAAEC,GAAW,EAAkB;IACtD,OAAO,IAAI,CAACH,KAAK,CAACI,oBAAoB,CAACD,GAAG,EAACD,GAAG,CAAC;EACjD;EACC;AACJ;AACA;AACA;AACA;AACA;EACGE,oBAAoBA,CAACD,GAAW,EAACD,GAAW,EAAkB;IAC7D,OAAO,IAAI,CAACF,KAAK,CAACI,oBAAoB,CAACD,GAAG,EAACD,GAAG,CAAC;EAChD;AAEF;AACO,MAAML,kBAAyC,GAAAJ,OAAA,CAAAI,kBAAA,GAAG,IAAIH,yBAAyB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TraceType","exports","FTReactNativeTraceWrapper","constructor","NativeModules","FTReactNativeTrace","setConfig","config","trace","getTraceHeader","key","url","getTraceHeaderFields"],"sources":["ft_tracing.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n//FTReactNativeTrace\n\n/**\n * Trace types for use.\n */\n export enum TraceType {\n //\n // datadog trace\n //\n // x-datadog-trace-id\n // x-datadog-parent-id\n // x-datadog-sampling-priority\n // x-datadog-origin\n //\n ddTrace,\n //\n // zipkin multi header\n //\n // X-B3-TraceId\n // X-B3-SpanId\n // X-B3-Sampled\n //\n zipkinMulti,\n /// zipkin single header,b3\n zipkinSingle,\n // w3c, traceparent\n traceparent,\n // skywalking 8.0+, sw-8\n skywalking,\n // jaeger, header uber-trace-id\n jaeger,\n };\n/**\n * Configure trace.\n * @param sampleRate sampling rate\n * @param traceType trace type\n * @param enableLinkRUMData whether to link with RUM data\n * @param enableNativeAutoTrace whether to enable automatic tracing\n */\n export interface FTTraceConfig{\n sampleRate?:number,\n traceType?:TraceType,\n enableLinkRUMData?:boolean,\n enableNativeAutoTrace?:boolean,\n };\n\n type FTReactNativeTraceType = {\n /**\n * Configure trace to enable distributed tracing.\n * @param config trace configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: FTTraceConfig): Promise<void>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n * @deprecated use getTraceHeaderFields() replace.\n */\n getTraceHeader(key:String, url: String): Promise<object>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n */\n getTraceHeaderFields(url: String,key?:String): Promise<object>;\n };\n\n class FTReactNativeTraceWrapper implements FTReactNativeTraceType {\n private trace: FTReactNativeTraceType = NativeModules.FTReactNativeTrace;\n\n\n setConfig(config:FTTraceConfig): Promise<void>{\n return this.trace.setConfig(config);\n }\n /**\n * Get trace HTTP request header data.\n * @param key unique id\n * @param url request URL\n * @returns a Promise.\n */\n getTraceHeader(key:String, url: String): Promise<object>{\n return this.trace.getTraceHeaderFields(url,key);\n }\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @param key unique id\n * @returns a Promise.\n */\n getTraceHeaderFields(url: String,key?:String): Promise<object>{\n return this.trace.getTraceHeaderFields(url,key);\n }\n\n }\n export const FTReactNativeTrace:FTReactNativeTraceType = new FTReactNativeTraceWrapper();\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAA6C,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAC7C;AAEA;AACA;AACA;AAFA,IAGagB,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AA0BpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;AAwBD,MAAME,yBAAyB,CAAmC;EAAAC,YAAA;IAAAtB,eAAA,gBACxBuB,0BAAa,CAACC,kBAAkB;EAAA;EAGxEC,SAASA,CAACC,MAAoB,EAAgB;IAC5C,OAAO,IAAI,CAACC,KAAK,CAACF,SAAS,CAACC,MAAM,CAAC;EACrC;EACD;AACF;AACA;AACA;AACA;AACA;EACGE,cAAcA,CAACC,GAAU,EAAEC,GAAW,EAAkB;IACtD,OAAO,IAAI,CAACH,KAAK,CAACI,oBAAoB,CAACD,GAAG,EAACD,GAAG,CAAC;EACjD;EACC;AACJ;AACA;AACA;AACA;AACA;EACGE,oBAAoBA,CAACD,GAAW,EAACD,GAAW,EAAkB;IAC7D,OAAO,IAAI,CAACF,KAAK,CAACI,oBAAoB,CAACD,GAAG,EAACD,GAAG,CAAC;EAChD;AAEF;AACO,MAAML,kBAAyC,GAAAJ,OAAA,CAAAI,kBAAA,GAAG,IAAIH,yBAAyB,CAAC,CAAC","ignoreList":[]}
@@ -105,6 +105,30 @@ Object.defineProperty(exports, "FTReactNativeTrace", {
105
105
  return _ft_tracing.FTReactNativeTrace;
106
106
  }
107
107
  });
108
+ Object.defineProperty(exports, "FTRemoteConfigOverrideMatch", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _ft_mobile_agent.FTRemoteConfigOverrideMatch;
112
+ }
113
+ });
114
+ Object.defineProperty(exports, "FTRemoteConfigOverrideRule", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return _ft_mobile_agent.FTRemoteConfigOverrideRule;
118
+ }
119
+ });
120
+ Object.defineProperty(exports, "FTRemoteConfigOverrideValues", {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _ft_mobile_agent.FTRemoteConfigOverrideValues;
124
+ }
125
+ });
126
+ Object.defineProperty(exports, "FTRemoteConfigResult", {
127
+ enumerable: true,
128
+ get: function () {
129
+ return _ft_mobile_agent.FTRemoteConfigResult;
130
+ }
131
+ });
108
132
  Object.defineProperty(exports, "FTRumActionTracking", {
109
133
  enumerable: true,
110
134
  get: function () {
@@ -123,6 +147,12 @@ Object.defineProperty(exports, "FTTraceConfig", {
123
147
  return _ft_tracing.FTTraceConfig;
124
148
  }
125
149
  });
150
+ Object.defineProperty(exports, "IOSCrashMonitoringType", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _ft_rum.IOSCrashMonitoringType;
154
+ }
155
+ });
126
156
  Object.defineProperty(exports, "TraceType", {
127
157
  enumerable: true,
128
158
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"names":["_ft_mobile_agent","require","_ft_logger","_ft_rum","_ft_tracing","_FTRumActionTracking","_FTRumErrorTracking"],"sources":["index.tsx"],"sourcesContent":["import {FTMobileConfig,FTMobileReactNative,EnvType,FTDBCacheDiscard} from './ft_mobile_agent'\nimport {FTLogConfig,FTReactNativeLog,FTLogStatus,FTLogCacheDiscard} from './ft_logger'\nimport {FTRUMConfig,FTRUMResource,FTReactNativeRUM,ErrorMonitorType,DeviceMetricsMonitorType,DetectFrequency,FTRUMResourceMetrics,FTRUMCacheDiscard} from './ft_rum'\nimport {FTTraceConfig,FTReactNativeTrace,TraceType} from './ft_tracing'\nimport {FTRumActionTracking} from './rum/FTRumActionTracking'\nimport {FTRumErrorTracking} from './rum/FTRumErrorTracking'\n\n \n export {\n FTMobileReactNative,FTMobileConfig,EnvType,FTDBCacheDiscard,\n FTLogConfig, FTReactNativeLog,FTLogStatus,FTLogCacheDiscard,\n FTRUMConfig,FTReactNativeRUM,FTRUMResource,ErrorMonitorType,DeviceMetricsMonitorType,DetectFrequency,FTRUMResourceMetrics,FTRUMCacheDiscard,\n FTTraceConfig,FTReactNativeTrace,TraceType,\n FTRumActionTracking,\n FTRumErrorTracking\n };\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_ft_mobile_agent","require","_ft_logger","_ft_rum","_ft_tracing","_FTRumActionTracking","_FTRumErrorTracking"],"sources":["index.tsx"],"sourcesContent":["import {FTMobileConfig,FTMobileReactNative,EnvType,FTDBCacheDiscard,FTRemoteConfigResult,\n FTRemoteConfigOverrideRule,FTRemoteConfigOverrideMatch,FTRemoteConfigOverrideValues} from './ft_mobile_agent'\nimport {FTLogConfig,FTReactNativeLog,FTLogStatus,FTLogCacheDiscard} from './ft_logger'\nimport {FTRUMConfig,FTRUMResource,FTReactNativeRUM,ErrorMonitorType,DeviceMetricsMonitorType,DetectFrequency,FTRUMResourceMetrics,FTRUMCacheDiscard,IOSCrashMonitoringType} from './ft_rum'\nimport {FTTraceConfig,FTReactNativeTrace,TraceType} from './ft_tracing'\nimport {FTRumActionTracking} from './rum/FTRumActionTracking'\nimport {FTRumErrorTracking} from './rum/FTRumErrorTracking'\n\n \n export {\n FTMobileReactNative,FTMobileConfig,EnvType,FTDBCacheDiscard,FTRemoteConfigResult,\n FTRemoteConfigOverrideRule,FTRemoteConfigOverrideMatch,FTRemoteConfigOverrideValues,\n FTLogConfig, FTReactNativeLog,FTLogStatus,FTLogCacheDiscard,\n FTRUMConfig,FTReactNativeRUM,FTRUMResource,ErrorMonitorType,DeviceMetricsMonitorType,DetectFrequency,FTRUMResourceMetrics,FTRUMCacheDiscard,IOSCrashMonitoringType,\n FTTraceConfig,FTReactNativeTrace,TraceType,\n FTRumActionTracking,\n FTRumErrorTracking\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA","ignoreList":[]}
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // generated by genversion
8
- const version = exports.version = '0.3.15';
8
+ const version = exports.version = '0.3.16';
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version","exports"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.3.15';\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["version","exports"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.3.16';\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ","ignoreList":[]}
@@ -2,6 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import { NativeModules } from 'react-native';
5
+ import { bridgeContextManager } from './ft_mobile_agent';
5
6
  /**
6
7
  * Set log level.
7
8
  */
@@ -53,11 +54,13 @@ class FTReactNativeLogWrapper {
53
54
  * @param property log context (optional)
54
55
  */
55
56
  logging(content, logStatus, property) {
57
+ // Automatically merge bridge context properties with local properties
58
+ const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);
56
59
  if (typeof logStatus === 'string') {
57
- return this.logger.logWithStatusString(content, logStatus.toString(), property);
60
+ return this.logger.logWithStatusString(content, logStatus.toString(), mergedProperties);
58
61
  }
59
62
  let enumLogStatus = logStatus;
60
- return this.logger.logging(content, enumLogStatus, property);
63
+ return this.logger.logging(content, enumLogStatus, mergedProperties);
61
64
  }
62
65
  }
63
66
  export const FTReactNativeLog = new FTReactNativeLogWrapper();
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","FTLogStatus","FTLogCacheDiscard","FTReactNativeLogWrapper","constructor","_defineProperty","FTReactNativeLog","logConfig","config","logger","logging","content","logStatus","property","logWithStatusString","toString","enumLogStatus"],"sources":["ft_logger.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n/**\n * Set log level.\n */\n export enum FTLogStatus {\n info, warning, error, critical, ok,\n };\n/**\n * Log discard method.\n */\n export enum FTLogCacheDiscard { discard, discardOldest };\n/**\n * Configure log output configuration.\n * @param sampleRate sampling rate\n * @param enableLinkRumData whether to link with RUM\n * @param enableCustomLog whether to enable custom logs\n * @param discardStrategy log discard strategy\n * @param logLevelFilters log level filter\n * @param globalContext custom global parameters\n * @param logCacheLimitCount get maximum log entry count limit [1000,), default 5000\n */\n export interface FTLogConfig{\n sampleRate?: number,\n enableLinkRumData?: boolean,\n enableCustomLog?: boolean,\n discardStrategy?: FTLogCacheDiscard,\n logLevelFilters?: Array<FTLogStatus>,\n globalContext?:object,\n logCacheLimitCount?: number\n };\n\n type FTReactNativeLogType = {\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(content:String,logStatus:FTLogStatus,property?:object): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logWithStatusString(content:String,logStatus:String,property?:object): Promise<void>;\n };\n\n class FTReactNativeLogWrapper {\n private logger: FTReactNativeLogType = NativeModules.FTReactNativeLog;\n\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config:FTLogConfig): Promise<void>{\n return this.logger.logConfig(config);\n }\n\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(content:String,logStatus:FTLogStatus|String,property?:object): Promise<void>{\n if((typeof logStatus)==='string'){\n return this.logger.logWithStatusString(content,logStatus.toString(),property)\n }\n let enumLogStatus: FTLogStatus = logStatus as FTLogStatus;\n return this.logger.logging(content,enumLogStatus,property);\n }\n }\n export const FTReactNativeLog: FTReactNativeLogWrapper = new FTReactNativeLogWrapper();\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C;AACA;AACA;AACC,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAEtB;AACF;AACA;AACA;AACC,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAA2B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASE;AAuBD,MAAMC,uBAAuB,CAAE;EAAAC,YAAA;IAAAC,eAAA,iBACUL,aAAa,CAACM,gBAAgB;EAAA;EAEtE;AACF;AACA;EACGC,SAASA,CAACC,MAAkB,EAAgB;IAC1C,OAAO,IAAI,CAACC,MAAM,CAACF,SAAS,CAACC,MAAM,CAAC;EACtC;;EAEA;AACH;AACA;AACA;AACA;AACA;EACGE,OAAOA,CAACC,OAAc,EAACC,SAA4B,EAACC,QAAgB,EAAgB;IAClF,IAAI,OAAOD,SAAS,KAAI,QAAQ,EAAC;MAC/B,OAAO,IAAI,CAACH,MAAM,CAACK,mBAAmB,CAACH,OAAO,EAACC,SAAS,CAACG,QAAQ,CAAC,CAAC,EAACF,QAAQ,CAAC;IAC/E;IACA,IAAIG,aAA0B,GAAGJ,SAAwB;IACzD,OAAO,IAAI,CAACH,MAAM,CAACC,OAAO,CAACC,OAAO,EAACK,aAAa,EAACH,QAAQ,CAAC;EAC5D;AACF;AACA,OAAO,MAAMP,gBAAyC,GAAG,IAAIH,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","bridgeContextManager","FTLogStatus","FTLogCacheDiscard","FTReactNativeLogWrapper","constructor","_defineProperty","FTReactNativeLog","logConfig","config","logger","logging","content","logStatus","property","mergedProperties","mergeWithLocalPropertiesSync","logWithStatusString","toString","enumLogStatus"],"sources":["ft_logger.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { bridgeContextManager } from './ft_mobile_agent';\n/**\n * Set log level.\n */\n export enum FTLogStatus {\n info, warning, error, critical, ok,\n };\n/**\n * Log discard method.\n */\n export enum FTLogCacheDiscard { discard, discardOldest };\n/**\n * Configure log output configuration.\n * @param sampleRate sampling rate\n * @param enableLinkRumData whether to link with RUM\n * @param enableCustomLog whether to enable custom logs\n * @param discardStrategy log discard strategy\n * @param logLevelFilters log level filter\n * @param globalContext custom global parameters\n * @param logCacheLimitCount get maximum log entry count limit [1000,), default 5000\n */\n export interface FTLogConfig{\n sampleRate?: number,\n enableLinkRumData?: boolean,\n enableCustomLog?: boolean,\n discardStrategy?: FTLogCacheDiscard,\n logLevelFilters?: Array<FTLogStatus>,\n globalContext?:object,\n logCacheLimitCount?: number\n };\n\n type FTReactNativeLogType = {\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(content:String,logStatus:FTLogStatus,property?:object): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logWithStatusString(content:String,logStatus:String,property?:object): Promise<void>;\n };\n\n class FTReactNativeLogWrapper {\n private logger: FTReactNativeLogType = NativeModules.FTReactNativeLog;\n\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config:FTLogConfig): Promise<void>{\n return this.logger.logConfig(config);\n }\n\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(content:String,logStatus:FTLogStatus|String,property?:object): Promise<void>{\n // Automatically merge bridge context properties with local properties\n const mergedProperties = bridgeContextManager.mergeWithLocalPropertiesSync(property);\n \n if((typeof logStatus)==='string'){\n return this.logger.logWithStatusString(content,logStatus.toString(),mergedProperties)\n }\n let enumLogStatus: FTLogStatus = logStatus as FTLogStatus;\n return this.logger.logging(content,enumLogStatus,mergedProperties);\n }\n }\n export const FTReactNativeLog: FTReactNativeLogWrapper = new FTReactNativeLogWrapper();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CAAC","ignoreList":[]}
@@ -1,9 +1,98 @@
1
+ var _BridgeContextManager;
1
2
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { NativeModules } from 'react-native';
5
+ import { NativeEventEmitter, NativeModules } from 'react-native';
5
6
  import { version as sdkVersion } from './version';
6
7
 
8
+ /**
9
+ * Bridge context manager for managing shared properties across RUM and Logger modules
10
+ * This class provides a centralized way to store and retrieve global properties that will be
11
+ * automatically merged with local properties when making calls to RUM and Logger functions
12
+ */
13
+ class BridgeContextManager {
14
+ constructor() {
15
+ _defineProperty(this, "properties", new Map());
16
+ // Initialize with SDK version information
17
+ this.initializeSDKInfo();
18
+ }
19
+
20
+ /**
21
+ * Initialize SDK information properties
22
+ * @private
23
+ */
24
+ initializeSDKInfo() {
25
+ // Create sdk_bridge_info with version information
26
+ const sdkBridgeInfo = {
27
+ react_native: sdkVersion
28
+ };
29
+
30
+ // Set the sdk_bridge_info property
31
+ this.properties.set('sdk_bridge_info', JSON.stringify(sdkBridgeInfo));
32
+ }
33
+
34
+ /**
35
+ * Get singleton instance of BridgeContextManager
36
+ * @returns BridgeContextManager instance
37
+ */
38
+ static getInstance() {
39
+ if (!BridgeContextManager.instance) {
40
+ BridgeContextManager.instance = new BridgeContextManager();
41
+ }
42
+ return BridgeContextManager.instance;
43
+ }
44
+
45
+ /**
46
+ * Add bridge context properties that will be automatically merged with local properties
47
+ * @param properties Object containing key-value pairs
48
+ */
49
+ appendBridgeContext(properties) {
50
+ // Store properties locally in JavaScript
51
+ try {
52
+ // Store properties locally in JavaScript
53
+ Object.entries(properties).forEach(([key, value]) => {
54
+ this.properties.set(key, value);
55
+ });
56
+ } catch (error) {
57
+ console.warn('Failed to append bridge context:', error);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Merge bridge context properties with local properties
63
+ * Bridge context properties take precedence over local properties
64
+ * @param localProperties Local properties to merge with bridge context properties
65
+ * @returns Merged properties object
66
+ */
67
+ mergeWithLocalPropertiesSync(localProperties) {
68
+ try {
69
+ const merged = {};
70
+
71
+ // First add local properties (if any)
72
+ if (localProperties) {
73
+ Object.assign(merged, localProperties);
74
+ }
75
+
76
+ // Then add bridge context properties (these will override local properties with same keys)
77
+ this.properties.forEach((value, key) => {
78
+ merged[key] = value;
79
+ });
80
+ return merged;
81
+ } catch (error) {
82
+ console.warn('Failed to merge bridge context with local properties:', error);
83
+ // Return empty object or only local properties on error
84
+ return localProperties ? {
85
+ ...localProperties
86
+ } : {};
87
+ }
88
+ }
89
+ }
90
+
91
+ // Internal bridge context manager - not exported
92
+ _BridgeContextManager = BridgeContextManager;
93
+ _defineProperty(BridgeContextManager, "instance", void 0);
94
+ export const bridgeContextManager = BridgeContextManager.getInstance();
95
+
7
96
  /**
8
97
  * Environment.
9
98
  */
@@ -22,6 +111,40 @@ export let FTDBCacheDiscard = /*#__PURE__*/function (FTDBCacheDiscard) {
22
111
  return FTDBCacheDiscard;
23
112
  }({});
24
113
  ;
114
+
115
+ /**
116
+ * Remote config override rule matching condition for custom keys. Supports exact match and contains match.
117
+ * For exact match, set the value directly, for example: "userid": "test_user", which means the rule will be applied when the custom key "userid" is exactly "test_user".
118
+ * For contains match, set the value as an object with a "contains" field, for example: "userid": { "contains": "test_user" }, which means the rule will be applied when the custom key "userid" contains the object "test_user".
119
+ */
120
+
121
+ /**
122
+ * Matching rules for remote config override
123
+ * Defines matching conditions using customKeys
124
+ */
125
+
126
+ /**
127
+ * Values that can be modified by remote config override rules.
128
+ * These values will adjust the fetched remote configuration before it is applied.
129
+ */
130
+
131
+ /**
132
+ * Remote config override rules .
133
+ * Adjust the fetched remote configuration before application.
134
+ */
135
+
136
+ /**
137
+ * Final result of the remote config update
138
+ * @param triggerType the type of remote config update trigger, auto or manual
139
+ * @param success whether the remote config update was successful
140
+ * @param platform the platform of the device, ios or android
141
+ * @param timestamp the timestamp when the remote config update was triggered
142
+ * @param rawJson the final remote config update result, in JSON string format
143
+ * @param errorCode the error code if the remote config update failed, may be null if the update was successful
144
+ * @param errorMessage the error message if the remote config update failed, may be null if the update was successful
145
+ * @param appliedOverrideRuleIds the list of override rule IDs applied in this remote config update, may be null if no rules were applied
146
+ */
147
+
25
148
  /**
26
149
  * Configure SDK startup parameters.
27
150
  * @param serverUrl data reporting address, deprecated, use [datakitUrl] instead
@@ -43,17 +166,20 @@ export let FTDBCacheDiscard = /*#__PURE__*/function (FTDBCacheDiscard) {
43
166
  * @param dbDiscardStrategy db data discard strategy
44
167
  * @param dataModifier data modifier, modify individual fields {key:value}, after setting, the SDK will replace the original value with the set value according to the key
45
168
  * @param lineDataModifier data modifier, modify single data {"measurement":measurement,"data":{key:value}}, after setting, the SDK will replace the original value with the set value according to the key
46
- */
169
+ * @param remoteConfiguration Set whether to enable remote dynamic configuration
170
+ * @param remoteConfigMiniUpdateInterval Set remote dynamic configuration minimum update interval, unit seconds, default 12*60*60
171
+ * @param remoteConfigOverrideRules Remote config override rules .Adjust the fetched remote configuration before application.
172
+ */
47
173
 
48
174
  class FTMobileReactNativeWrapper {
49
175
  constructor() {
50
176
  _defineProperty(this, "sdk", NativeModules.FTMobileReactNative);
177
+ _defineProperty(this, "emitter", new NativeEventEmitter(NativeModules.FTMobileReactNative));
51
178
  }
52
179
  sdkConfig(config) {
53
180
  if (config.serverUrl != null && config.serverUrl.length > 0 && config.datakitUrl == null) {
54
181
  config.datakitUrl = config.serverUrl;
55
182
  }
56
- config.pkgInfo = sdkVersion;
57
183
  return this.sdk.sdkConfig(config);
58
184
  }
59
185
  bindRUMUserData(userId, userName, userEmail, extra) {
@@ -83,6 +209,19 @@ class FTMobileReactNativeWrapper {
83
209
  clearAllData() {
84
210
  return this.sdk.clearAllData();
85
211
  }
212
+ appendBridgeContext(properties) {
213
+ // Use bridgeContextManager to store properties in JavaScript and send to native SDK
214
+ bridgeContextManager.appendBridgeContext(properties);
215
+ }
216
+ updateRemoteConfig() {
217
+ return this.sdk.updateRemoteConfig();
218
+ }
219
+ updateRemoteConfigWithMiniUpdateInterval(interval, rules) {
220
+ return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval, rules);
221
+ }
222
+ addRemoteConfigListener(listener) {
223
+ return this.emitter.addListener('ft_remote_config_callback', listener);
224
+ }
86
225
  }
87
226
  export const FTMobileReactNative = new FTMobileReactNativeWrapper();
88
227
  //# sourceMappingURL=ft_mobile_agent.js.map