Repository navigation
Conversation
Restores the screen tracking API that was dropped in 1.0.0, with identical semantics on both platforms: a sticky screen label plus one app state collection per call.
A name reported before configuration was lost; it is now stored and applied once setSiftConfig runs, on both platforms.
The iOS SDK renamed the manual screen label selector in sift-ios#167.
The Sift SDK is a singleton for the life of the process, so module-instance state went stale after a JS reload and left a screen label that JS could no longer clear.
collect only requests a collection and uploads on the normal schedule, clearing is not symmetric across platforms, and the historical note moved out of the released 1.0.0 section.
The property moved into the companion object, so the instance-qualified assignment did not compile.
Android already collects there, so without this the first screen was not reported until an automatic collection.
The three forwarding tests only asserted that a jest mock received what it was just handed.
They claimed success even before setSiftConfig, when the native call does nothing, and CLEAR left the input populated.
ostfrost
marked this pull request as ready for review
October 13, 2026 15:27
Latest stable; the release is build-system and generated-model changes only, and the wrapper uses no com.sift.api.representations types directly.
The SDK now owns the screen name and clears it on null, so the module no longer stores the name or threads it through Sift.open and Sift.resume.
Clearing returns to each SDK's automatic value, which on Android in a React Native app is the React context class name, not an empty field.
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.
Purpose
Restore screen tracking in the React Native SDK with parity between iOS and Android (MSUE-242). The old
setPageNamewas Android-only and was dropped in the RN 0.81 / TurboModule upgrade (PR #47, v1.0.0) without a changelog entry, so today screen names are reported on neither platform. Raised by Reward Gateway.Summary
New method on the TurboModule spec:
Contract, identical on both platforms: a sticky screen label that stays attached to later app state collections until it is changed or cleared; each call also requests one collection;
nullor an empty string clears it and returns to the SDK's automatic value; a call beforesetSiftConfigcollects nothing, and the name is applied once the SDK is configured; the label survives background and foreground.Both platforms delegate to a native SDK API that owns the label:
[Sift setScreenTitle:]from sift-ios#167 (MSUE-243), followed bycollect.setSiftConfigcollects when a label is already set, so the first screen is reported right away.Sift.setScreenTitle(String)from sift-android#116, followed bySift.collect(). Requiressift-android1.4.0.The configured flag is kept process-wide (Kotlin companion object, ObjC file statics under
@synchronized), because the Sift SDK is a process-wide singleton and a JS reload creates a new module instance.Why the Android side moved to a new SDK API
The first version of this PR worked with the API Android already had:
Sift.open(context, name)to set the label. That had two problems.Sift.open()andSift.resume()coalesce anullname tocontext.getClass().getSimpleName(). SosetPageName(null)on Android did not clear the label, it wrote the React context class name, while on iOSnilrestores the automatic value. Same call, different meaning per platform. Fixing this by changing the coalescing in the SDK would break the documented per-Activity integration, whereSift.open(this)with no name relies on it, so a separate setter was the only safe option.Sift.resume()on return from background and everySift.open()insetSiftConfigoverwrote it. The module had to keep its own copy and thread it back throughopenandresume. That is the exact behaviour that silently broke the old 2022 implementation.sift-android#116 adds
Sift.setScreenTitle(String)with the same shape as iOS: a manual label kept separately from the automatic name, used when set, cleared bynull. With it the module no longer stores the name and no longer passes it throughopenandresume, andnullmeans the same thing on both platforms.Clearing returns to each SDK's automatic value, and those values differ: on iOS a React Native app has none, so the field is omitted; on Android it is the React context class name, for example
BridgelessReactContext. This is documented in the README.Also: README API reference and usage, CHANGELOG, example app controls, and one unit test asserting the method on the spec surface.
Dependencies
This PR is ready for review but must not be merged before both native releases:
setScreenTitle:). Then add aSiftversion floor to the podspec, pin it in the example Podfile, refresh the lock, and replace the PR links in README and CHANGELOG with the version.sift-android1.4.0 containing sift-android#116. The wrapper already pinscom.siftscience:sift-android:1.4.0, which will resolve once it is published.Known limitations
Sift.collect()produces the event from the location callback, so it can be delayed or skipped.import android.text.TextUtils, dead since the 1.0.0 migration.Testing
Automated:
yarn lint,yarn typecheckandyarn testpass.Android, end to end against
sift-android1.4.0 published to Maven Local from sift-android#116, example app on an API 37 emulator,activity_class_namefrom logcat:setPageName('BeforeConfig')beforesetSiftConfigsetSiftConfig+uploadBeforeConfigBeforeConfig(x2, one per collection)setPageName('Checkout')CheckoutCheckoutsetSiftConfig+uploadCheckoutCheckout(x2)setPageName(null)BridgelessReactContextiOS (iPhone 16 Pro simulator, iOS 18.6, sift-ios built from PR #167):
ios_app_statecarrieswindow_root_view_controller_titles = ["Checkout"], the label survives backgrounding, andnullclears it.Coverage note: the unit test asserts the method on the bridge surface, not the native behaviour. The repo has no Android or iOS test targets and no CI, so native tests are a separate ticket; the native behaviour is covered by the SDKs' own tests (sift-android#116 adds three).
Checklist