-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IAF branch from master #221
Open
dan-peluso
wants to merge
11
commits into
master
Choose a base branch
from
feature/IAM-post-3.0.3-rebase
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+813
−18
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f0a6065
CHNL-13253 IAM Basic Webview + Module Scaffolding (#194)
dan-peluso 8c667c4
[CHNL-14635] Fetch Full Forms (#197)
dan-peluso bb3b4c9
Revert "[CHNL-14635] Fetch Full Forms (#197)"
dan-peluso 1819a13
Rebase resulted in funky code duplication
8b453b8
[CHNL-16219] Updating IAF branch with local setup + removing unused c…
dan-peluso 3101df4
[CHNL-16653] Enqueue Profile Events (#209)
dan-peluso a9f9dc5
[CHNL-16656] Enqueue Aggregate Events from IAF (#212)
dan-peluso 2a26f67
[CHNL-16704] Deeplink Support for IAF (#213)
dan-peluso ca82adc
changing event names
dan-peluso 9d2e9f5
IAF handshake (#216)
evan-masseau 8ba3c57
[CHNL-17236] Timeout + Handshake (#220)
dan-peluso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
...ytics/src/main/java/com/klaviyo/analytics/networking/requests/AggregateEventApiRequest.kt
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 @@ | ||
package com.klaviyo.analytics.networking.requests | ||
|
||
import com.klaviyo.core.Registry | ||
import org.json.JSONObject | ||
|
||
typealias AggregateEventPayload = JSONObject | ||
internal class AggregateEventApiRequest( | ||
queuedTime: Long? = null, | ||
uuid: String? = null | ||
) : KlaviyoApiRequest(PATH, RequestMethod.POST, queuedTime, uuid) { | ||
|
||
companion object { | ||
private const val PATH = "onsite/track-analytics" | ||
} | ||
|
||
override val type: String = "Create Aggregate Event" | ||
override var query: Map<String, String> = mapOf( | ||
COMPANY_ID to Registry.config.apiKey | ||
) | ||
|
||
override val successCodes: IntRange get() = HTTP_ACCEPTED..HTTP_ACCEPTED | ||
|
||
constructor(payload: AggregateEventPayload) : this() { | ||
body = payload | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package com.klaviyo.analytics.networking.requests | |
import com.klaviyo.analytics.DevicePropertiesTest | ||
import com.klaviyo.analytics.model.Profile | ||
import com.klaviyo.fixtures.BaseTest | ||
import org.json.JSONObject | ||
import org.junit.Assert | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
@@ -30,6 +31,53 @@ internal abstract class BaseApiRequestTest<T> : BaseTest() where T : KlaviyoApiR | |
.setEmail(EMAIL) | ||
.setPhoneNumber(PHONE) | ||
|
||
open val stubAggregateEventPayload = JSONObject( | ||
""" | ||
{ | ||
"type": "aggregateEventTracked", | ||
"data": { | ||
"metric_group": "signup-forms", | ||
"events": [ | ||
{ | ||
"metric": "stepSubmit", | ||
"log_to_statsd": true, | ||
"log_to_s3": true, | ||
"log_to_metrics_service": true, | ||
"metric_service_event_name": "submitted_form_step", | ||
"event_details": { | ||
"form_version_c_id": "1", | ||
"is_client": true, | ||
"submitted_fields": { | ||
"source": "Local Form", | ||
"email": "[email protected]", | ||
"consent_method": "Klaviyo Form", | ||
"consent_form_id": "64CjgW", | ||
"consent_form_version": 3, | ||
"sent_identifiers": {}, | ||
"sms_consent": true, | ||
"step_name": "Email Opt-In" | ||
}, | ||
"step_name": "Email Opt-In", | ||
"step_number": 1, | ||
"action_type": "Submit Step", | ||
"form_id": "64CjgW", | ||
"form_version_id": 3, | ||
"form_type": "POPUP", | ||
"device_type": "DESKTOP", | ||
"hostname": "localhost", | ||
"href": "http://localhost:4001/onsite/js/", | ||
"page_url": "http://localhost:4001/onsite/js/", | ||
"first_referrer": "http://localhost:4001/onsite/js/", | ||
"referrer": "http://localhost:4001/onsite/js/", | ||
"cid": "ODZjYjJmMjUtNjliMC00ZGVlLTllM2YtNDY5YTlmNjcwYmUz" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
""".trimIndent() | ||
) | ||
|
||
abstract fun makeTestRequest(): T | ||
|
||
@Before | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,38 @@ | ||
project.description = 'In-app messaging functionality for the Klaviyo SDK suite' | ||
evan-masseau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
evaluationDependsOn(':sdk') | ||
|
||
def ext = rootProject.ext | ||
|
||
android { | ||
namespace "${klaviyoGroupId}.messaging" | ||
|
||
publishing { | ||
singleVariant(ext.publishBuildVariant) { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(':sdk:core') | ||
implementation project(':sdk:analytics') | ||
|
||
implementation AndroidX.webkit | ||
|
||
testImplementation project(':sdk:fixtures') | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
// Creates a Maven publication called "release". | ||
release(MavenPublication) { | ||
from components[ext.publishBuildVariant] | ||
groupId = klaviyoGroupId | ||
artifactId = 'messaging' | ||
version = readXmlValue('src/main/res/values/strings.xml','klaviyo_sdk_version_override', project(":sdk:core")) | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
<manifest /> |
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,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head data-sdk-name="SDK_NAME" | ||
data-sdk-version="SDK_VERSION" | ||
data-native-bridge-name="BRIDGE_NAME" | ||
data-native-bridge-handshake='BRIDGE_HANDSHAKE' | ||
> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Klaviyo In-App Form Template</title> | ||
<script type="text/javascript" src="KLAVIYO_JS_URL"></script> | ||
</head> | ||
<body></body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrm, where is this used?