Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add multi bundle into devices #932

Merged
merged 1 commit into from
Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
@@ -1546,13 +1546,15 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG
* @param {string} id the device id
* @param {PushProvider} push_provider the push provider
* @param {string} [userID] the user id (defaults to current user)
* @param {string} [push_provider_name] user provided push provider name for multi bundle support
*
*/
async addDevice(id: string, push_provider: PushProvider, userID?: string) {
async addDevice(id: string, push_provider: PushProvider, userID?: string, push_provider_name?: string) {
return await this.post<APIResponse>(this.baseURL + '/devices', {
id,
push_provider,
...(userID != null ? { user_id: userID } : {}),
...(push_provider_name != null ? { push_provider_name } : {}),
});
}

1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1696,6 +1696,7 @@ export type Device<StreamChatGenerics extends ExtendableGenerics = DefaultGeneri
export type BaseDeviceFields = {
id: string;
push_provider: PushProvider;
push_provider_name?: string;
};

export type DeviceFields = BaseDeviceFields & {