Skip to content

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

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

jferrao-itrbl wants to merge 1 commit 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.w); does not throw. 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 logcat, no crash; disableDeviceForCurrentUser() still disables push for the current user.
  • After NativeRNIterableAPI.ts change, regenerate codegen (cd example/ios && pod install). Note: full pod install may currently fail on the pre-existing Iterable-iOS-SDK pin mismatch (podspec 6.6.7 vs Podfile.lock 6.7.5, SDK-709). Codegen for this method already succeeds.

🧾 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

Copy link
Copy Markdown
Lines Statements Branches Functions
Coverage: 72%
72.02% (582/808) 61.22% (229/374) 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.1%.

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.

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