From 36b3f1ae38b970efbcf75e85940e67d4f7d42cd4 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Mon, 16 Sep 2024 15:49:05 +0100 Subject: [PATCH] fix --- .../android/build.gradle | 6 +++--- .../android/gradle.properties | 10 +++++----- ...ule.kt => PostHogReactNativeSessionReplayModule.kt} | 2 +- ...ge.kt => PostHogReactNativeSessionReplayPackage.kt} | 4 ++-- .../ios/PosthogReactNativeSessionReplay.mm | 2 +- .../ios/PosthogReactNativeSessionReplay.swift | 4 ++-- posthog-react-native-session-replay/src/index.tsx | 6 +++--- posthog-react-native/package.json | 4 ++-- .../src/optional/OptionalSessionReplay.ts | 2 +- yarn.lock | 3 +++ 10 files changed, 23 insertions(+), 20 deletions(-) rename posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/{PosthogReactNativeSessionReplayModule.kt => PostHogReactNativeSessionReplayModule.kt} (90%) rename posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/{PosthogReactNativeSessionReplayPackage.kt => PostHogReactNativeSessionReplayPackage.kt} (77%) diff --git a/posthog-react-native-session-replay/android/build.gradle b/posthog-react-native-session-replay/android/build.gradle index 4d6b0fe8..03dbb38e 100644 --- a/posthog-react-native-session-replay/android/build.gradle +++ b/posthog-react-native-session-replay/android/build.gradle @@ -1,6 +1,6 @@ buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault - def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["PosthogReactNativeSessionReplay_kotlinVersion"] + def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["PostHogReactNativeSessionReplay_kotlinVersion"] repositories { google() @@ -31,11 +31,11 @@ if (isNewArchitectureEnabled()) { } def getExtOrDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["PosthogReactNativeSessionReplay_" + name] + return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["PostHogReactNativeSessionReplay_" + name] } def getExtOrIntegerDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PosthogReactNativeSessionReplay_" + name]).toInteger() + return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PostHogReactNativeSessionReplay_" + name]).toInteger() } def supportsNamespace() { diff --git a/posthog-react-native-session-replay/android/gradle.properties b/posthog-react-native-session-replay/android/gradle.properties index dbb94542..06084b3f 100644 --- a/posthog-react-native-session-replay/android/gradle.properties +++ b/posthog-react-native-session-replay/android/gradle.properties @@ -1,5 +1,5 @@ -PosthogReactNativeSessionReplay_kotlinVersion=1.7.0 -PosthogReactNativeSessionReplay_minSdkVersion=21 -PosthogReactNativeSessionReplay_targetSdkVersion=31 -PosthogReactNativeSessionReplay_compileSdkVersion=31 -PosthogReactNativeSessionReplay_ndkversion=21.4.7075529 +PostHogReactNativeSessionReplay_kotlinVersion=1.7.0 +PostHogReactNativeSessionReplay_minSdkVersion=21 +PostHogReactNativeSessionReplay_targetSdkVersion=31 +PostHogReactNativeSessionReplay_compileSdkVersion=31 +PostHogReactNativeSessionReplay_ndkversion=21.4.7075529 diff --git a/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayModule.kt b/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayModule.kt similarity index 90% rename from posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayModule.kt rename to posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayModule.kt index 674fd750..df1e240c 100644 --- a/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayModule.kt +++ b/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayModule.kt @@ -5,7 +5,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod import com.facebook.react.bridge.Promise -class PosthogReactNativeSessionReplayModule(reactContext: ReactApplicationContext) : +class PostHogReactNativeSessionReplayModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { override fun getName(): String { diff --git a/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayPackage.kt b/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayPackage.kt similarity index 77% rename from posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayPackage.kt rename to posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayPackage.kt index a0a85bb8..3820c93f 100644 --- a/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PosthogReactNativeSessionReplayPackage.kt +++ b/posthog-react-native-session-replay/android/src/main/java/com/posthog/android/replay/PostHogReactNativeSessionReplayPackage.kt @@ -6,9 +6,9 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.uimanager.ViewManager -class PosthogReactNativeSessionReplayPackage : ReactPackage { +class PostHogReactNativeSessionReplayPackage : ReactPackage { override fun createNativeModules(reactContext: ReactApplicationContext): List { - return listOf(PosthogReactNativeSessionReplayModule(reactContext)) + return listOf(PostHogReactNativeSessionReplay(reactContext)) } override fun createViewManagers(reactContext: ReactApplicationContext): List> { diff --git a/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.mm b/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.mm index 40687bb7..4a716533 100644 --- a/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.mm +++ b/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.mm @@ -1,6 +1,6 @@ #import -@interface RCT_EXTERN_MODULE(PosthogReactNativeSessionReplay, NSObject) +@interface RCT_EXTERN_MODULE(PostHogReactNativeSessionReplay, NSObject) RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b withResolver:(RCTPromiseResolveBlock)resolve diff --git a/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.swift b/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.swift index 4d5cca62..3f476b23 100644 --- a/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.swift +++ b/posthog-react-native-session-replay/ios/PosthogReactNativeSessionReplay.swift @@ -1,5 +1,5 @@ -@objc(PosthogReactNativeSessionReplay) -class PosthogReactNativeSessionReplay: NSObject { +@objc(PostHogReactNativeSessionReplay) +class PostHogReactNativeSessionReplay: NSObject { @objc(multiply:withB:withResolver:withRejecter:) func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void { diff --git a/posthog-react-native-session-replay/src/index.tsx b/posthog-react-native-session-replay/src/index.tsx index d452add2..2cac0569 100644 --- a/posthog-react-native-session-replay/src/index.tsx +++ b/posthog-react-native-session-replay/src/index.tsx @@ -6,8 +6,8 @@ const LINKING_ERROR = '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; -const PosthogReactNativeSessionReplay = NativeModules.PosthogReactNativeSessionReplay - ? NativeModules.PosthogReactNativeSessionReplay +const PostHogReactNativeSessionReplay = NativeModules.PostHogReactNativeSessionReplay + ? NativeModules.PostHogReactNativeSessionReplay : new Proxy( {}, { @@ -18,5 +18,5 @@ const PosthogReactNativeSessionReplay = NativeModules.PosthogReactNativeSessionR ); export function multiply(a: number, b: number): Promise { - return PosthogReactNativeSessionReplay.multiply(a, b); + return PostHogReactNativeSessionReplay.multiply(a, b); } diff --git a/posthog-react-native/package.json b/posthog-react-native/package.json index 96672280..898ee07a 100644 --- a/posthog-react-native/package.json +++ b/posthog-react-native/package.json @@ -33,7 +33,7 @@ "react-native": "^0.69.1", "react-native-device-info": "^10.3.0", "react-native-navigation": "^6.0.0", - "posthog-react-native-session-replay": "^0.1.0" + "posthog-react-native-session-replay": "file:../posthog-react-native-session-replay" }, "peerDependencies": { "@react-native-async-storage/async-storage": ">=1.0.0", @@ -44,7 +44,7 @@ "expo-localization": ">= 11.0.0", "react-native-device-info": ">= 10.0.0", "react-native-navigation": ">=6.0.0", - "posthog-react-native-session-replay": ">=0.1.0" + "posthog-react-native-session-replay": "file:../posthog-react-native-session-replay" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { diff --git a/posthog-react-native/src/optional/OptionalSessionReplay.ts b/posthog-react-native/src/optional/OptionalSessionReplay.ts index ce921668..8781730f 100644 --- a/posthog-react-native/src/optional/OptionalSessionReplay.ts +++ b/posthog-react-native/src/optional/OptionalSessionReplay.ts @@ -1,5 +1,5 @@ import { Platform } from 'react-native' -// import type ReactNativeSessionReplay from 'posthog-react-native-session-replay' +// import type PosthogReactNativeSessionReplay from 'posthog-react-native-session-replay' import type ReactNativeSessionReplay from '../replay/ReactNativeSessionReplay' export let OptionalReactNativeSessionReplay: typeof ReactNativeSessionReplay | undefined = undefined diff --git a/yarn.lock b/yarn.lock index 776a376d..a7b74d54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8597,6 +8597,9 @@ possible-typed-array-names@^1.0.0: resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== +"posthog-react-native-session-replay@file:posthog-react-native-session-replay": + version "0.1.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"