Skip to content
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

Add feedback survey option chosen event #4528

Merged
merged 16 commits into from
Dec 10, 2024
Merged

Conversation

vegaro
Copy link
Contributor

@vegaro vegaro commented Nov 29, 2024

Creates an event with this definition:

struct CustomerCenterEventSurveyOptionChosen {
    let id: String?
    var type: EventType // customer_center_survey_option_chosen
    var appUserID: String
    var appSessionID: String
    var timestamp: UInt64
    var path: String // CUSTOM_URL
    var url: String? // URL if CUSTOM_URL
    var surveyOptionID: String
    var additionalContext: String? // null for now until we support
    var darkMode: Bool
    var locale: String
    var isSandbox: Bool
    var displayMode: FULL_SCREEN | SHEET
    var revisionId: Int
}

Base automatically changed from create-customer-center-event to main December 2, 2024 14:43
@vegaro vegaro force-pushed the create-feedback-survey-event branch from c2bf7c5 to 3a163a4 Compare December 2, 2024 14:47
Copy link

emerge-tools bot commented Dec 4, 2024

1 build increased size

Name Version Download Change Install Change Approval
Paywalls
com.revenuecat.PaywallsTester
1.0 (1) 10.6 MB ⬆️ 32.4 kB (0.31%) 39.2 MB ⬆️ 154.7 kB (0.4%) N/A

Paywalls 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 154.7 kB (0.4%)
Total download size change: ⬆️ 32.4 kB (0.31%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 46.0 kB
RevenueCat.InternalAPI.InternalAPI ⬆️ 9.4 kB
DYLD.Exports ⬆️ 4.4 kB
Code Signature ⬆️ 3.7 kB
RevenueCatUI.FeedbackSurveyData.FeedbackSurveyData ⬆️ 3.1 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

@vegaro vegaro force-pushed the create-feedback-survey-event branch from f1eeadd to 24ee89f Compare December 5, 2024 09:44
@vegaro vegaro marked this pull request as ready for review December 5, 2024 19:09
@vegaro vegaro requested a review from a team December 5, 2024 19:09
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably missing why we need the CustomerCenterSurveyOptionChosenEvent instead of relying on CustomerCenterEvent

/// An event to be sent by the `RevenueCatUI` SDK.
public enum CustomerCenterEvent: FeatureEvent, CustomerCenterEventType {

var eventDiscriminator: String? { "lifecycle" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I'm confused by this default event discriminator... Should this be something like customer_center? We could also make it a computed property based on the enum values I guess.

guard let event = CustomerCenterEvent(storedEvent: storedEvent) else {
return nil
switch storedEvent.eventDiscriminator {
case "survey_option_chosen":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm can we store these into some sort of enum? Would be better to avoid hardcoded strings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I need to do this

Sources/CustomerCenter/Events/CustomerCenterEvent.swift Outdated Show resolved Hide resolved
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a naming suggestion, besides Toni's comments.

@vegaro vegaro force-pushed the create-feedback-survey-event branch from 376815a to ed98ba6 Compare December 9, 2024 19:54
@vegaro vegaro force-pushed the create-feedback-survey-event branch from ed98ba6 to 17ea410 Compare December 9, 2024 19:56
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

appSessionID: Self.appSessionID))
let requestEvent: EventsRequest.CustomerCenterEvent = try XCTUnwrap(.init(storedEvent: storedEvent))
appSessionID: Self.appSessionID,
eventDiscriminator: "lifecycle"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can potentially use the new discriminator enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Thanks!

@vegaro vegaro merged commit eb334de into main Dec 10, 2024
9 of 10 checks passed
@vegaro vegaro deleted the create-feedback-survey-event branch December 10, 2024 13:32
This was referenced Dec 11, 2024
@vegaro vegaro added pr:feat A new feature and removed pr:other labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants