Skip to content

feat(SDK-550): expose disableDeviceForAllUsers on the RN SDK - #901

Open
jferrao-itrbl wants to merge 2 commits into
feature/SDK-548-feature-parityfrom
feature/SDK-550-disable-device-all-users
Open

jferrao-itrbl wants to merge 2 commits into
feature/SDK-548-feature-parityfrom
feature/SDK-550-disable-device-all-users

Conversation

@jferrao-itrbl

@jferrao-itrbl jferrao-itrbl commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

📝 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 public IterableAPI.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):

  • iOS: forwards to IterableAPI.disableDeviceForAllUsers().
  • Android: logged no-op (IterableLogger in JS/Metro and IterableLogger.w in logcat); does not throw. The native TurboModule method is still invoked. Use disableDeviceForCurrentUser() for current-user disable.

disableDeviceForCurrentUser is unchanged. Native Android public API and iOS async throws / callback variants are out of scope.

🧪 How to test?

  • yarn typecheck and yarn test pass.
  • iOS: initialize, register a token, call Iterable.disableDeviceForAllUsers(), confirm the device token is disabled for all users associated with the device (same native behavior as IterableAPI.disableDeviceForAllUsers()).
  • iOS edge: call before initialize() / with no token — should not crash (native handles internally; RN does not surface success/failure).
  • Android: call Iterable.disableDeviceForAllUsers() — warning in Metro (when logReactNativeSdkCalls is on) and logcat, no crash; disableDeviceForCurrentUser() still disables push for the current user.
  • After NativeRNIterableAPI.ts change, regenerate codegen (cd example/ios && pod install). Confirmed working (podspec and Podfile.lock both pin Iterable-iOS-SDK 6.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.

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>
@jferrao-itrbl
jferrao-itrbl requested a review from a team as a code owner September 16, 2026 19:55
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Lines Statements Branches Functions
Coverage: 72%
72.09% (584/810) 61.43% (231/376) 67.43% (176/261)

@qltysh

qltysh Bot commented Sep 16, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on feature/SDK-548-feature-parity by 0.2%.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
src/core/classes/IterableApi.ts100.0%
Coverage rating: A Coverage rating: A
src/core/classes/Iterable.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

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>
@jferrao-itrbl

Copy link
Copy Markdown
Collaborator Author

Thanks for the notes.

  1. Agreed — that pin note was stale. Both sides are 6.6.7; SDK-709 is the planned bump, not a current pod install failure. Description updated: dropped that paragraph and marked AC 11 done.

  2. Kept the Android bridge no-op as specified (wakeApp is the inverse: Android-only real work). Native warning stays in logcat. Added a JS-layer IterableLogger.log on Android with the same message so the gap is visible in Metro when logReactNativeSdkCalls is on, then still call the native method. See 8c0841bf.

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.

2 participants