diff --git a/android/app/build.gradle b/android/app/build.gradle index f722d8426b7e..7008770fce01 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -15,6 +15,7 @@ fullstory { org 'o-1WN56P-na1' enabledVariants 'all' logcatLevel 'debug' + recordOnStart false } react { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 3473c2bfcec8..cf23834fb1cb 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -45,6 +45,8 @@ OrgId o-1WN56P-na1 + RecordOnStart + ITSAppUsesNonExemptEncryption diff --git a/src/Expensify.tsx b/src/Expensify.tsx index f96c51961acc..6151f983e8d0 100644 --- a/src/Expensify.tsx +++ b/src/Expensify.tsx @@ -19,6 +19,7 @@ import * as Report from './libs/actions/Report'; import * as User from './libs/actions/User'; import * as ActiveClientManager from './libs/ActiveClientManager'; import BootSplash from './libs/BootSplash'; +import FS from './libs/Fullstory'; import * as Growl from './libs/Growl'; import Log from './libs/Log'; import migrateOnyx from './libs/migrateOnyx'; @@ -147,6 +148,9 @@ function Expensify({ // Initialize this client as being an active client ActiveClientManager.init(); + // Initialize Fullstory lib + FS.init(); + // Used for the offline indicator appearing when someone is offline const unsubscribeNetInfo = NetworkConnection.subscribeToNetInfo(); diff --git a/src/libs/Fullstory/index.native.ts b/src/libs/Fullstory/index.native.ts index 4a7551beca77..1adb607bcfca 100644 --- a/src/libs/Fullstory/index.native.ts +++ b/src/libs/Fullstory/index.native.ts @@ -1,6 +1,9 @@ import FullStory, {FSPage} from '@fullstory/react-native'; import type {OnyxEntry} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; +import CONST from '@src/CONST'; import * as Environment from '@src/libs/Environment/Environment'; +import ONYXKEYS from '@src/ONYXKEYS'; import type {UserMetadata} from '@src/types/onyx'; /** @@ -8,6 +11,21 @@ import type {UserMetadata} from '@src/types/onyx'; * Proxy function calls to React-Native lib * */ const FS = { + /** + * Initializes FullStory + */ + init: () => { + Environment.getEnvironment().then((envName: string) => { + // We only want to start fullstory if the app is running in production + if (envName !== CONST.ENVIRONMENT.PRODUCTION) { + return; + } + FullStory.restart(); + const [session] = useOnyx(ONYXKEYS.USER_METADATA); + FS.fsIdentify(session); + }); + }, + /** * Sets the identity as anonymous using the FullStory library. */ diff --git a/src/libs/Fullstory/index.ts b/src/libs/Fullstory/index.ts index a9c75ad838e9..8419bccabb90 100644 --- a/src/libs/Fullstory/index.ts +++ b/src/libs/Fullstory/index.ts @@ -92,6 +92,11 @@ const FS = { }); } }, + + /** + * Init function, created so we're consistent with the native file + */ + init: () => {}, }; export default FS; diff --git a/web/index.html b/web/index.html index 41c85ec188da..acccbbe4f442 100644 --- a/web/index.html +++ b/web/index.html @@ -118,7 +118,7 @@ - <% if (htmlWebpackPlugin.options.isWeb && (htmlWebpackPlugin.options.isProduction || htmlWebpackPlugin.options.isStaging)) { %> + <% if (htmlWebpackPlugin.options.isWeb && htmlWebpackPlugin.options.isProduction) { %> @@ -126,7 +126,7 @@ - <% if (htmlWebpackPlugin.options.isWeb && (htmlWebpackPlugin.options.isProduction || htmlWebpackPlugin.options.isStaging)) { %> + <% if (htmlWebpackPlugin.options.isWeb && htmlWebpackPlugin.options.isProduction) { %>