Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Sep 25, 2023
1 parent 6a2704b commit 35ff27c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 22 deletions.
5 changes: 0 additions & 5 deletions posthog-android/api/posthog-android.api
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ public final class com/posthog/android/PostHogAndroid$Companion {
public final fun with (Landroid/content/Context;Lcom/posthog/PostHogConfig;)Lcom/posthog/PostHog;
}

public final class com/posthog/android/internal/PostHogAndroidNetworkStatus : com/posthog/internal/PostHogNetworkStatus {
public fun <init> (Landroid/content/Context;)V
public fun isConnected ()Z
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ internal class PostHogAndroidContext(private val context: Context, private val c
staticContext["\$screen_width"] = displayMetrics.widthPixels

getPackageInfo(context, config)?.let {
// TODO: check if we should use getApplicationInfo instead
it.applicationInfo?.loadLabel(context.packageManager)?.let { name ->
staticContext["\$app_name"] = name
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.posthog.android.internal

import android.content.Context
import com.posthog.internal.PostHogNetworkStatus
import com.posthog.PostHogNetworkStatus

public class PostHogAndroidNetworkStatus(private val context: Context) : PostHogNetworkStatus {
internal class PostHogAndroidNetworkStatus(private val context: Context) : PostHogNetworkStatus {
override fun isConnected(): Boolean {
return context.isConnected()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ fun Greeting(name: String, modifier: Modifier = Modifier) {
// PostHog.optOut()
// PostHog.optIn()
// PostHog.identify("my_distinct_id", properties = mapOf("my_property" to 1), userProperties = mapOf("name" to "hello"))
// PostHog.capture("testEvent", mapOf("testProperty" to "testValue"))
PostHog.capture("testEvent", properties = mapOf("testProperty" to "testValue"))
// PostHog.reloadFeatureFlagsRequest()
PostHog.isFeatureEnabled("sessionRecording")
// PostHog.isFeatureEnabled("sessionRecording")
// val props = mutableMapOf<String, Any>()
// props["test_key"] = "test_value"
// PostHog.group("theType", "theKey", groupProperties = props)
Expand Down
12 changes: 6 additions & 6 deletions posthog/api/posthog.api
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public final class com/posthog/PostHogConfig {
public final fun getLogger ()Lcom/posthog/PostHogLogger;
public final fun getMaxBatchSize ()I
public final fun getMaxQueueSize ()I
public final fun getNetworkStatus ()Lcom/posthog/internal/PostHogNetworkStatus;
public final fun getNetworkStatus ()Lcom/posthog/PostHogNetworkStatus;
public final fun getOptOut ()Z
public final fun getPreloadFeatureFlags ()Z
public final fun getSdkName ()Ljava/lang/String;
Expand All @@ -86,7 +86,7 @@ public final class com/posthog/PostHogConfig {
public final fun setLogger (Lcom/posthog/PostHogLogger;)V
public final fun setMaxBatchSize (I)V
public final fun setMaxQueueSize (I)V
public final fun setNetworkStatus (Lcom/posthog/internal/PostHogNetworkStatus;)V
public final fun setNetworkStatus (Lcom/posthog/PostHogNetworkStatus;)V
public final fun setOptOut (Z)V
public final fun setPreloadFeatureFlags (Z)V
public final fun setSdkVersion (Ljava/lang/String;)V
Expand Down Expand Up @@ -140,6 +140,10 @@ public abstract interface class com/posthog/PostHogLogger {
public abstract fun log (Ljava/lang/String;)V
}

public abstract interface class com/posthog/PostHogNetworkStatus {
public abstract fun isConnected ()Z
}

public abstract interface class com/posthog/PostHogPreferences {
public abstract fun clear (Ljava/util/List;)V
public abstract fun getValue (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
Expand All @@ -156,7 +160,3 @@ public final class com/posthog/PostHogPrintLogger : com/posthog/PostHogLogger {
public fun log (Ljava/lang/String;)V
}

public abstract interface class com/posthog/internal/PostHogNetworkStatus {
public abstract fun isConnected ()Z
}

1 change: 0 additions & 1 deletion posthog/src/main/java/com/posthog/PostHogConfig.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.posthog

import PostHog.posthog.BuildConfig
import com.posthog.internal.PostHogNetworkStatus

public class PostHogConfig(
// apiKey and host are immutable due to offline caching
Expand Down
1 change: 1 addition & 0 deletions posthog/src/main/java/com/posthog/PostHogContext.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.posthog

@PostHogInternal
public interface PostHogContext {
public fun getStaticContext(): Map<String, Any>

Expand Down
1 change: 1 addition & 0 deletions posthog/src/main/java/com/posthog/PostHogLogger.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.posthog

@PostHogInternal
public interface PostHogLogger {
public fun log(message: String)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.posthog.internal
package com.posthog

@PostHogInternal
public interface PostHogNetworkStatus {
public fun isConnected(): Boolean
}
1 change: 1 addition & 0 deletions posthog/src/main/java/com/posthog/PostHogPreferences.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.posthog

@PostHogInternal
public interface PostHogPreferences {
public fun getValue(key: String, defaultValue: Any? = null): Any?

Expand Down
1 change: 1 addition & 0 deletions posthog/src/main/java/com/posthog/PostHogPrintLogger.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.posthog

@PostHogInternal
public class PostHogPrintLogger(private val config: PostHogConfig) : PostHogLogger {
override fun log(message: String) {
if (!config.debug) {
Expand Down
4 changes: 0 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// type safe project access
// enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
repositories {
google()
Expand All @@ -17,7 +14,6 @@ dependencyResolutionManagement {
}

rootProject.name = "PostHog"
// rootProject.buildFileName = "build.gradle.kts"

include(":posthog")
include(":posthog-android")
Expand Down

0 comments on commit 35ff27c

Please sign in to comment.