Skip to content

MSUE-243: Adds API to manually override automatic class collection - #167

Open
apolwork wants to merge 2 commits into
SiftScience:masterfrom
apolwork:set-pagename-api
Open

apolwork wants to merge 2 commits into
SiftScience:masterfrom
apolwork:set-pagename-api

Conversation

@apolwork

@apolwork apolwork commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

iOS labels app-state events with a screen name only through automatic visible view controller class name capture. There was no way to set the label manually.

Summary

Adds -[Sift setTitle:].

  • setTitle:@"Checkout" sets a label that every later app-state collection carries in window_root_view_controller_titles: periodic, app-became-active, navigation and collect. It overrides the auto-detected view controller class name.
  • setTitle:nil resets it, so the per-event / navigation title is used again. Empty strings and non-strings (e.g. NSNull from a bridge) also reset.
  • Label only, setTitle: doesn't collect. Call collect to send an event right away.
  • The label is stored in an atomic, copy property (manualLabel) on SiftIosAppStateCollector, so it's safe to call from any thread and is visible to the next collection immediately. Kept in memory, not archived.
  • No change for apps that never call setTitle:. Event payloads are the same as before.

Testing

  • new tests check the emitted event's window_root_view_controller_titles:
    • testSetManualTitleDoesNotCollect
    • testManualTitleIsUsedByLaterCollections
    • testManualTitleSurvivesAutomaticNavigationTitle
    • testAutomaticNavigationTitleDoesNotPersist
    • testManualTitleInBackground
    • testNilResetsManualTitle
    • testManualTitleEmptyOrNonStringResets
    • SiftTests.testSetTitleIsUsedByLaterCollections

Checklist

  • The change was thoroughly tested manually
  • The change was covered with unit tests
  • The change was tested with the integration example

@apolwork apolwork changed the title Adds API to manually override automatic class collection MSUE-243: Adds API to manually override automatic class collection Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant