[CLNP-8557] Migrate sample call sites to registerDevicePushTokenForMultiDevicePush - #203
Merged
Conversation
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).
unique (false) for registerDevicePushToken
tezpark
approved these changes
Jun 3, 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
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.
Summary
Updates all 8
SendbirdChat.registerDevicePushToken(_:unique:completionHandler:)call sites across 5 sample apps to use the newSendbirdChat.registerDevicePushTokenForMultiDevicePush(_:completionHandler:)convenience method introduced in chat-ios PR #1745.Behavior change: the previous call form
unique: trueis replaced by the new method, which is equivalent tounique: false. Multi-device push is the intended demonstration here —unique: truedisables device-token local caching and was misleading in these reference samples.Why
registerDevicePushTokenForMultiDevicePush(_:completionHandler:)convenience method that registers the device token with multi-device push enabled (equivalent tounique: false): https://github.com/sendbird/chat-ios/pull/1745unique: truedisables device-token local caching on the SDK side (PushTokenRepository.swiftcache-hit branch is bypassed whenisUniqueis true).Why the rename (not a default-arg)?
Earlier iterations of chat-ios PR #1745 tried (1)
unique: Bool = falsedefault and (2) a no-uniquearity-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 toregisterDevicePushTokenForMultiDevicePushfor explicit semantic naming.Caller behavior change
SendbirdChat.registerDevicePushToken(token, unique: true) { ... }SendbirdChat.registerDevicePushTokenForMultiDevicePush(token) { ... }unique: true→unique: 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
registerDevicePushTokenForMultiDevicePushships and this repo'sSendbirdChatSDKdependency 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:
4.40.0or next minor)SendbirdChatSDKpin in this repo to the released versionTest plan
Jira: https://sendbird.atlassian.net/browse/CLNP-8557