-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(posthog): support group analytics
- Loading branch information
Showing
11 changed files
with
219 additions
and
6 deletions.
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
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
44 changes: 44 additions & 0 deletions
44
...src/main/java/io/capawesome/capacitorjs/plugins/posthog/classes/options/GroupOptions.java
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,44 @@ | ||
package io.capawesome.capacitorjs.plugins.posthog.classes.options; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.getcapacitor.JSObject; | ||
|
||
import org.json.JSONException; | ||
|
||
import java.util.Map; | ||
|
||
import io.capawesome.capacitorjs.plugins.posthog.PosthogHelper; | ||
|
||
public class GroupOptions { | ||
@NonNull | ||
private String type; | ||
|
||
@NonNull | ||
private String key; | ||
|
||
@Nullable | ||
private Map<String, Object> groupProperties; | ||
|
||
public GroupOptions(@NonNull String type, @NonNull String key, @Nullable JSObject groupProperties) throws JSONException { | ||
this.type = type; | ||
this.key = key; | ||
this.groupProperties = PosthogHelper.createHashMapFromJSONObject(groupProperties); | ||
} | ||
|
||
@NonNull | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@NonNull | ||
public String getKey() { | ||
return key; | ||
} | ||
|
||
@Nullable | ||
public Map<String, Object> getGroupProperties() { | ||
return groupProperties; | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
packages/posthog/ios/Plugin/Classes/Options/GroupOptions.swift
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,26 @@ | ||
import Foundation | ||
import Capacitor | ||
|
||
@objc public class GroupOptions: NSObject { | ||
private var type: String | ||
private var key: String | ||
private var groupProperties: [String: Any]? | ||
|
||
init(type: String, key: String, groupProperties: [String: Any]?) { | ||
self.type = type | ||
self.key = key | ||
self.groupProperties = groupProperties | ||
} | ||
|
||
func getType() -> String { | ||
return type | ||
} | ||
|
||
func getKey() -> String { | ||
return key | ||
} | ||
|
||
func getGroupProperties() -> [String: Any]? { | ||
return groupProperties | ||
} | ||
} |
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
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
Oops, something went wrong.