diff --git a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/AndroidInstallDocs.tsx b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/AndroidInstallDocs.tsx index 822084593..cfc153583 100644 --- a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/AndroidInstallDocs.tsx +++ b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/AndroidInstallDocs.tsx @@ -3,7 +3,7 @@ import stl from './installDocs.module.css'; import cn from 'classnames'; import Highlight from 'react-highlight'; import CircleNumber from '../../CircleNumber'; -import {CopyButton} from 'UI'; +import { CopyButton } from 'UI'; export const installationCommand = `// Add it in your root build.gradle at the end of repositories: dependencyResolutionManagement { @@ -27,11 +27,11 @@ import com.openreplay.tracker.OpenReplay class MainActivity : TrackingActivity() { override fun onCreate(savedInstanceState: Bundle?) { // not required if you're using our SaaS version - OpenReplay.serverURL = "https://your.instance.com/ingest" + OpenReplay.serverURL = "INGEST_POINT" // check out our SDK docs to see available options OpenReplay.start( applicationContext, - "projectkey", + "PROJECT_KEY", OpenReplay.Options.defaults(), onStarted = { println("OpenReplay Started") @@ -40,7 +40,7 @@ class MainActivity : TrackingActivity() { // ... } }`; -const configuration = `let crashs: Bool +const configuration = `let crashes: Bool let analytics: Bool let performances: Bool let logs: Bool @@ -57,38 +57,38 @@ const sensitive = `import com.openreplay.tracker.OpenReplay OpenReplay.addIgnoredView(view) ` -const inputs = `import com.opnereplay.tracker.OpenReplay +const inputs = `import com.openreplay.tracker.OpenReplay val passwordEditText = binding.password passwordEditText.trackTextInput(label = "password", masked = true)` -function AndroidInstallDocs({site}: any) { - const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey); +function AndroidInstallDocs({ site, ingestPoint }: any) { + let _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey).replace('INGEST_POINT', ingestPoint); return (
- + Install the SDK
- +
{installationCommand}
- + Add to your app
- +
{_usageCode}
@@ -96,7 +96,7 @@ function AndroidInstallDocs({site}: any) {
- + Configuration
@@ -110,14 +110,14 @@ function AndroidInstallDocs({site}: any) {
- + Set up touch events listener
- +
{touches}
@@ -125,14 +125,14 @@ function AndroidInstallDocs({site}: any) {
- + Hide sensitive views
- +
{sensitive}
@@ -140,14 +140,14 @@ function AndroidInstallDocs({site}: any) {
- + Track inputs
- +
{inputs}
@@ -157,4 +157,4 @@ function AndroidInstallDocs({site}: any) { ); } -export default AndroidInstallDocs +export default AndroidInstallDocs; diff --git a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/MobileInstallDocs.tsx b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/MobileInstallDocs.tsx index c2de52485..401a67ef0 100644 --- a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/MobileInstallDocs.tsx +++ b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/MobileInstallDocs.tsx @@ -25,14 +25,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // not required if you're using our SaaS version - OpenReplay.shared.serverURL = "https://your.instance.com/ingest" + OpenReplay.shared.serverURL = "INGEST_POINT" OpenReplay.shared.start(projectKey: "PROJECT_KEY", options: .defaults) // ... return true } // ...`; -const configuration = `let crashs: Bool +const configuration = `let crashes: Bool let analytics: Bool let performances: Bool let logs: Bool @@ -72,8 +72,8 @@ TextField("Input", text: $text) // UIKit will use placeholder as label and sender.isSecureTextEntry to mask the input Analytics.shared.addObservedInput(inputEl)` -function MobileInstallDocs({ site }: any) { - const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey); +function MobileInstallDocs({ site, ingestPoint }: any) { + const _usageCode = usageCode.replace('INGEST_POINT', ingestPoint).replace('PROJECT_KEY', site.projectKey); return (
diff --git a/frontend/app/components/Onboarding/components/OnboardingTabs/OnboardingMobileTabs.tsx b/frontend/app/components/Onboarding/components/OnboardingTabs/OnboardingMobileTabs.tsx index abfb00f77..e88a8d95e 100644 --- a/frontend/app/components/Onboarding/components/OnboardingTabs/OnboardingMobileTabs.tsx +++ b/frontend/app/components/Onboarding/components/OnboardingTabs/OnboardingMobileTabs.tsx @@ -21,6 +21,7 @@ const MobileTrackingCodeModal = (props: Props) => { const { site } = props; const [activeTab, setActiveTab] = useState(iOS); const { showModal } = useModal(); + const ingestPoint = `https://${window.location.hostname}/ingest`; const showUserModal = () => { showModal(, { right: true }); @@ -32,7 +33,7 @@ const MobileTrackingCodeModal = (props: Props) => { return (
- +
@@ -55,7 +56,7 @@ const MobileTrackingCodeModal = (props: Props) => { return (
- +
diff --git a/frontend/app/components/shared/TrackingCodeModal/InstallIosDocs.tsx b/frontend/app/components/shared/TrackingCodeModal/InstallIosDocs.tsx index c39a70f5e..06965c8a5 100644 --- a/frontend/app/components/shared/TrackingCodeModal/InstallIosDocs.tsx +++ b/frontend/app/components/shared/TrackingCodeModal/InstallIosDocs.tsx @@ -7,12 +7,12 @@ import stl from './InstallDocs/installDocs.module.css' import { usageCode as iosUsageCode, installationCommand as iosInstallCommand } from "../../Onboarding/components/OnboardingTabs/InstallDocs/MobileInstallDocs"; import { usageCode as androidUsageCode, installationCommand as androidInstallCommand } from "../../Onboarding/components/OnboardingTabs/InstallDocs/AndroidInstallDocs"; -function InstallMobileDocs({ site }) { +function InstallMobileDocs({ site, ingestPoint }: any) { const [isIos, setIsIos] = React.useState(true) const usageCode = isIos ? iosUsageCode : androidUsageCode const installationCommand = isIos ? iosInstallCommand : androidInstallCommand - const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey) + const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey).replace('INGEST_POINT', ingestPoint) const docLink = `https://docs.openreplay.com/en/${isIos ? 'ios-' : 'android-'}sdk/` return ( @@ -54,4 +54,4 @@ function InstallMobileDocs({ site }) { ) } -export default InstallMobileDocs \ No newline at end of file +export default InstallMobileDocs diff --git a/frontend/app/components/shared/TrackingCodeModal/TrackingCodeModal.js b/frontend/app/components/shared/TrackingCodeModal/TrackingCodeModal.js index 3b7094293..3530e15c4 100644 --- a/frontend/app/components/shared/TrackingCodeModal/TrackingCodeModal.js +++ b/frontend/app/components/shared/TrackingCodeModal/TrackingCodeModal.js @@ -34,7 +34,8 @@ class TrackingCodeModal extends React.PureComponent { render() { const { title = '', subTitle, site } = this.props; const { activeTab } = this.state; - console.log(this.props.site); + const ingestPoint = `https://${window.location.hostname}/ingest`; + return (
- +
) : (