feat(SDK-550): expose disableDeviceForAllUsers on the RN SDK - #901
jferrao-itrbl wants to merge 2 commits into
Conversation
Bridge Iterable.disableDeviceForAllUsers() so iOS can unregister this device's push token for every associated user. Android stays a logged no-op because the native SDK has no public equivalent. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (2)
🛟 Help
|
Keep the native bridge no-op, but emit the same unsupported warning from JS so the gap is visible without logcat when logReactNativeSdkCalls is on. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the notes.
|

📝 Summary
Add
Iterable.disableDeviceForAllUsers()so RN apps can unregister this device's push token for every associated user on iOS.🎟️ Jira Ticket: SDK-550
📖 Description
The RN SDK only bridged
disableDeviceForCurrentUser. iOS already has publicIterableAPI.disableDeviceForAllUsers(); Android does not have a public "all users" equivalent (disablePush()is current-user only;disableToken(...)is protected).This PR adds
Iterable.disableDeviceForAllUsers()/IterableApi.disableDeviceForAllUsers()(no args, fire-and-forget):IterableAPI.disableDeviceForAllUsers().IterableLoggerin JS/Metro andIterableLogger.win logcat); does not throw. The native TurboModule method is still invoked. UsedisableDeviceForCurrentUser()for current-user disable.disableDeviceForCurrentUseris unchanged. Native Android public API and iOSasync throws/ callback variants are out of scope.🧪 How to test?
yarn typecheckandyarn testpass.Iterable.disableDeviceForAllUsers(), confirm the device token is disabled for all users associated with the device (same native behavior asIterableAPI.disableDeviceForAllUsers()).initialize()/ with no token — should not crash (native handles internally; RN does not surface success/failure).Iterable.disableDeviceForAllUsers()— warning in Metro (whenlogReactNativeSdkCallsis on) and logcat, no crash;disableDeviceForCurrentUser()still disables push for the current user.NativeRNIterableAPI.tschange, regenerate codegen (cd example/ios && pod install). Confirmed working (podspec andPodfile.lockboth pinIterable-iOS-SDK6.6.7).🧾 Changelog
Unreleased: added
Iterable.disableDeviceForAllUsers()(iOS native forward; Android logged no-op).📹 Loom recording if applicable
N/A
🐞 Github Issues solved
N/A
📚 Docs PR if applicable
JSDoc on
Iterable.disableDeviceForAllUsers()documents the iOS-only effect and Android no-op (picked up by TypeDoc). Follow-up docs-repo PR if product docs should mention the new method.