feat(audience-sample-app): add sample app for ImmutableAudience SDK [SDK-152]#711
Open
ImmutableJeffrey wants to merge 5 commits intomainfrom
Open
feat(audience-sample-app): add sample app for ImmutableAudience SDK [SDK-152]#711ImmutableJeffrey wants to merge 5 commits intomainfrom
ImmutableJeffrey wants to merge 5 commits intomainfrom
Conversation
55515d7 to
92d670a
Compare
92d670a to
6983964
Compare
…format envelope key Two transport-layer fixes surfaced during sample-app testing: * HttpTransport includes the response body in the OnError message for 4xx/5xx responses. Previous "HTTP 400" rows gave studios no actionable signal; the body string carries the validation reason. * Wire-format envelope key is "messages", not "batch". The backend ingest path expects "messages" and the prior key silently dropped events. Tests updated for both.
Roboto-Regular.ttf and RobotoMono-Regular.ttf for sample-app text (prose and monospace respectively). Apache 2.0 LICENSE files included alongside.
Unity-package wiring for the sample under examples/audience: * Packages/manifest.json points at com.immutable.audience locally * Scripts/Immutable.Audience.Samples.SampleApp.asmdef declares the sample assembly + dependencies * Top-level README Removes Assets/Scenes.meta (legacy folder meta — sample's scene now lives at Assets/SampleApp/Scenes/).
Visual layer for the sample app — these reference each other: * SampleApp.unity scene with a UIDocument component * AudienceSampleAppPanelSettings panel settings asset (referenced by the UIDocument) * AudienceSampleAppTheme.tss theme stylesheet (referenced by the panel settings) * AudienceSample.uxml visual tree — header, status bar, tab bar, controls + log columns, drag handle * Templates/Accordion.uxml — typed-events accordion template (cloned per Catalogue entry at runtime) * AudienceSample.uss stylesheet with shared tokens (--bg, --panel-bg, --text, --accent, --ok, --warn, --err, --debug, --transparent, --text-on-accent, ...) and ~95 selectors covering tabs, accordions, status bar, log rows, drag handle, responsive single-column layout below 1024px width.
Three partials of the AudienceSample MonoBehaviour, each with one
concern:
* AudienceSample.cs SDK calls, On* handlers, mirror state, SDK
callbacks (OnError, Log.Writer adapter),
config builders. Reads UXML state ONLY via
UI's Capture*Form accessors — never touches
a UXML field directly.
* AudienceSample.UI.cs UXML fields, binding, rendering, log pane
mechanics, drag-resize, Refresh* methods,
Capture*Form accessors. No SDK calls.
* AudienceSample.Events.cs Catalogue (typed + string events), typed-
event factory, props builder. Pure factory:
no UXML, no SDK.
Form-snapshot DTOs (InitForm, IdentifyForm, AliasForm, CustomEventForm)
hand button-click state from UI to main. Refresh* fan-out collapses to
OnSdkStateChanged.
Threading: SDK OnError fires from background flush threads; AppendLog
captures SynchronizationContext + main thread id at startup and
re-dispatches via SyncContext.Post on off-main entry. Required because
_logView.schedule.Execute silently drops off-main callers in 2021.3
runtime panels.
The log pane caps at 200 rows (oldest evicted on overflow) with
stateless per-row "was at bottom?" auto-scroll. Each row stashes its
LogEntry on userData so the visual tree IS the log data — no parallel
buffer to maintain.
6983964 to
9e825b9
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a sample app under
examples/audienceexercising every publicImmutableAudienceAPI across four tabs (Setup, Consent, Typed Events, Identity) plus an event log mirroring SDK debug output.Linear: SDK-152