Skip to content

Commit

Permalink
feat: add multi bundle into devices (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas authored Mar 23, 2022
1 parent 25aa13f commit 014e470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {}),
});
}

Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 & {
Expand Down

0 comments on commit 014e470

Please sign in to comment.