Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Sep 16, 2024
1 parent f49d69f commit 36b3f1a
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
6 changes: 3 additions & 3 deletions posthog-react-native-session-replay/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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() {
Expand Down
10 changes: 5 additions & 5 deletions posthog-react-native-session-replay/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<NativeModule> {
return listOf(PosthogReactNativeSessionReplayModule(reactContext))
return listOf(PostHogReactNativeSessionReplay(reactContext))
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(PosthogReactNativeSessionReplay, NSObject)
@interface RCT_EXTERN_MODULE(PostHogReactNativeSessionReplay, NSObject)

RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
withResolver:(RCTPromiseResolveBlock)resolve
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions posthog-react-native-session-replay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{},
{
Expand All @@ -18,5 +18,5 @@ const PosthogReactNativeSessionReplay = NativeModules.PosthogReactNativeSessionR
);

export function multiply(a: number, b: number): Promise<number> {
return PosthogReactNativeSessionReplay.multiply(a, b);
return PostHogReactNativeSessionReplay.multiply(a, b);
}
4 changes: 2 additions & 2 deletions posthog-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/src/optional/OptionalSessionReplay.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 36b3f1a

Please sign in to comment.