Skip to content

[CLNP-8557] Migrate sample call sites to registerDevicePushTokenForMultiDevicePush - #203

Merged
lookdeceline merged 3 commits into
mainfrom
device-token-unique
Jun 11, 2026
Merged

[CLNP-8557] Migrate sample call sites to registerDevicePushTokenForMultiDevicePush#203
lookdeceline merged 3 commits into
mainfrom
device-token-unique

Conversation

@lookdeceline

@lookdeceline lookdeceline commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates all 8 SendbirdChat.registerDevicePushToken(_:unique:completionHandler:) call sites across 5 sample apps to use the new SendbirdChat.registerDevicePushTokenForMultiDevicePush(_:completionHandler:) convenience method introduced in chat-ios PR #1745.

Behavior change: the previous call form unique: true is replaced by the new method, which is equivalent to unique: false. Multi-device push is the intended demonstration here — unique: true disables device-token local caching and was misleading in these reference samples.

Why

  • chat-ios is adding a registerDevicePushTokenForMultiDevicePush(_:completionHandler:) convenience method that registers the device token with multi-device push enabled (equivalent to unique: false): https://github.com/sendbird/chat-ios/pull/1745
  • Calling with unique: true disables device-token local caching on the SDK side (PushTokenRepository.swift cache-hit branch is bypassed when isUnique is true).
  • The new method's name explicitly documents the multi-device-push behavior at the call site, so customers reading the samples immediately understand what's happening.

Why the rename (not a default-arg)?

Earlier iterations of chat-ios PR #1745 tried (1) unique: Bool = false default and (2) a no-unique arity-overloaded method. Both were rejected — the default-arg doesn't expose to Obj-C callers (Swift defaults are invisible to the generated Obj-C header), and the arity overload hid the semantic difference behind the same Swift name. The final v3 approach renames the method to registerDevicePushTokenForMultiDevicePush for explicit semantic naming.

Caller behavior change

Sample call (before this PR) Sample call (after this PR) Behavior change
SendbirdChat.registerDevicePushToken(token, unique: true) { ... } SendbirdChat.registerDevicePushTokenForMultiDevicePush(token) { ... } unique: trueunique: false (multi-device, cache-friendly)

Files

  • Apps/PushNotificationsGroupChannel/Sources/UseCase/PushNotificationUseCase.swift (2 calls)
  • Apps/PushNotificationsTranslationGroupChannel/Sources/UseCase/PushNotificationUseCase.swift (2 calls)
  • Apps/PushNotificationsTranslationGroupChannel/Sources/UseCase/UserConnectionUseCase.swift (1 call)
  • Apps/UserDoNotDisturbSnooze/Sources/UseCase/PushNotificationUseCase.swift (2 calls)
  • Modules/CommonModule/Sources/UseCase/User/UserConnectionUseCase.swift (1 call)

Status — Draft

This PR is in Draft until the chat-ios release that contains registerDevicePushTokenForMultiDevicePush ships and this repo's SendbirdChatSDK dependency is bumped to that version. Without the bump, the new method won't be available and the changed call sites would fail to compile against the currently-pinned SDK.

Sequence:

  1. chat-ios PR #1745 merges
  2. chat-ios releases (e.g. 4.40.0 or next minor)
  3. Bump SendbirdChatSDK pin in this repo to the released version
  4. Mark this PR Ready for Review

Test plan

  • After dependency bump: builds without errors against the new chat-ios
  • Push notification flow still works in each affected sample app
  • Code review

Jira: https://sendbird.atlassian.net/browse/CLNP-8557

The chat-ios SDK now defaults `unique` to `false` for
`SendbirdChat.registerDevicePushToken(_:unique:completionHandler:)`,
which enables device token local caching on the SDK side. Omitting the
`unique` argument lets these samples benefit from caching automatically.

Customer-facing reference: showing the cache-friendly call form here
encourages new integrations to adopt it by default.

Jira: CLNP-8557
Follow the chat-ios SDK rename from the no-`unique` overload to the
explicitly-named `registerDevicePushTokenForMultiDevicePush`. Updates
all 8 sample call sites previously updated in this PR (which removed
`unique: true` in favor of the convenience form).
@lookdeceline lookdeceline changed the title [CLNP-8557] Use default unique (false) for registerDevicePushToken [CLNP-8557] Migrate sample call sites to registerDevicePushTokenForMultiDevicePush Jun 1, 2026
`registerDevicePushTokenForMultiDevicePush(_:completionHandler:)` was
introduced in SendbirdChatSDK 4.39.5 (per the chat-ios CHANGELOG entry
dated Jun 08, 2026). The sample call sites migrated in this PR rely on
that symbol, so the pinned dependency must move forward — leaving it on
4.24.1 would make the samples fail to compile against the very API the
PR is meant to demonstrate.

Verified by building the Samples-Workspace aggregate scheme (47 sample
apps) on iPhone 16 simulator and by exercising the new API at runtime
with a fake 32-byte token (returns `.pending` as documented when no
user is connected, no crash).

Jira: CLNP-8557
@lookdeceline lookdeceline self-assigned this Jun 11, 2026
@lookdeceline
lookdeceline marked this pull request as ready for review June 11, 2026 07:52
@lookdeceline
lookdeceline merged commit 05a3c79 into main Jun 11, 2026
2 checks passed
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