-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
489b6aa
commit c8fa399
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
posthog-react-native/src/optional/OptionalSessionReplay.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Platform } from 'react-native' | ||
// import type ReactNativeSessionReplay from 'posthog-react-native-session-replay' | ||
import type ReactNativeSessionReplay from '../replay/ReactNativeSessionReplay' | ||
|
||
export let OptionalReactNativeSessionReplay: typeof ReactNativeSessionReplay | undefined = undefined | ||
|
||
try { | ||
// macos not supported | ||
OptionalReactNativeSessionReplay = Platform.select({ | ||
macos: undefined, | ||
web: undefined, | ||
windows: undefined, | ||
native: undefined, | ||
default: require('posthog-react-native-session-replay'), // Only Android and iOS | ||
}) | ||
} catch (e) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
posthog-react-native/src/replay/ReactNativeSessionReplay.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// auto generated by posthog-react-native-session-replay | ||
|
||
import type { ReactNativeSessionReplayStatic } from './ReactNativeSessionReplayStatic'; | ||
declare const ReactNativeSessionReplay: ReactNativeSessionReplayStatic; | ||
export default ReactNativeSessionReplay; |
9 changes: 9 additions & 0 deletions
9
posthog-react-native/src/replay/ReactNativeSessionReplayStatic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// auto generated by posthog-react-native-session-replay | ||
|
||
export declare type ReactNativeSessionReplayStatic = { | ||
|
||
start: (sessionId: string, endpoint: string) => Promise<void>; | ||
startSession: (sessionId: string) => Promise<void>; | ||
endSession: () => Promise<void>; | ||
isEnabled: () => Promise<boolean>; | ||
} |