diff --git a/.gitignore b/.gitignore index d8fc9a0..6a339c0 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ android/keystores/debug.keystore lib/ env.ts +src/version.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index abf797d..3431d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [1.1.1](https://github.com/sendbird/sendbird-calls-sdk-react-native/compare/v1.0.3...v1.1.1) (2024-01-29) + + +### Bug Fixes + +* remove ghost package.json from build binary to avoid missing type declaration ([a33ef06](https://github.com/sendbird/sendbird-calls-sdk-react-native/commit/a33ef06552532c66a1098229ba200eba07bf3f87)) + + +### Features + +* **CLNP-1920:** sdk update, integrate logger ([#38](https://github.com/sendbird/sendbird-calls-sdk-react-native/issues/38)) ([4ce705a](https://github.com/sendbird/sendbird-calls-sdk-react-native/commit/4ce705ad5630d22ffba54dbc0281e28eaa141212)) + # [1.1.0](https://github.com/sendbird/sendbird-calls-sdk-react-native/compare/v1.0.3...v1.1.0) (2024-01-12) diff --git a/CHANGELOG_DRAFT.md b/CHANGELOG_DRAFT.md index 2f188d0..0e79605 100644 --- a/CHANGELOG_DRAFT.md +++ b/CHANGELOG_DRAFT.md @@ -1,6 +1,4 @@ -## v1.1.0 +## v1.1.1 + +- Fixed the issue of being unable to find TypeScript definitions caused by ghost package.json -- Updated native SDK - - Added `onLocalParticipantReconnected` and `onLocalParticipantDisconnected` to group call events - - Added `NOT_CONNECTED` to DirectCallEndResult -- Integrated logger with native diff --git a/docs/classes/DirectCall.html b/docs/classes/DirectCall.html index c0cea0e..0ccb6fb 100644 --- a/docs/classes/DirectCall.html +++ b/docs/classes/DirectCall.html @@ -1,118 +1,118 @@ -DirectCall | @sendbird/calls-react-native
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DirectCall

Implements

Index

Constructors

Accessors

Accessors

  • get videoViewId(): number

Methods

  • UNSAFE_componentWillMount(): void
  • +

Accessors

  • get videoViewId(): number

Methods

  • UNSAFE_componentWillMount(): void
  • Called immediately before mounting occurs, and before Component#render. Avoid introducing any side-effects or subscriptions in this method.

    This method will not stop working in React 17.

    @@ -85,7 +85,7 @@ things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    -

    Parameters

    Returns any

  • render(): Element
  • setState<K>(state: null | {} | ((prevState: Readonly<{}>, props: Readonly<DirectCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void)): void
  • Type Parameters

    • K extends never

    Parameters

    • state: null | {} | ((prevState: Readonly<{}>, props: Readonly<DirectCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • shouldComponentUpdate(nextProps: Readonly<DirectCallVideoViewProps>, nextState: Readonly<{}>, nextContext: any): boolean
  • +

    Parameters

    Returns any

  • render(): Element
  • setState<K>(state: null | {} | ((prevState: Readonly<{}>, props: Readonly<DirectCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void)): void
  • Type Parameters

    • K extends never

    Parameters

    • state: null | {} | ((prevState: Readonly<{}>, props: Readonly<DirectCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • shouldComponentUpdate(nextProps: Readonly<DirectCallVideoViewProps>, nextState: Readonly<{}>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any diff --git a/docs/classes/GroupCallVideoView.html b/docs/classes/GroupCallVideoView.html index 0219d3a..f66bad7 100644 --- a/docs/classes/GroupCallVideoView.html +++ b/docs/classes/GroupCallVideoView.html @@ -13,7 +13,7 @@

    type MyContext = number
    const Ctx = React.createContext<MyContext>(0)

    class Foo extends React.Component {
    static contextType = Ctx
    context!: React.ContextType<typeof Ctx>
    render () {
    return <>My context's value: {this.context}</>;
    }
    }
    see

    https://react.dev/reference/react/Component#static-contexttype

    -

Accessors

  • get videoViewId(): number

Methods

  • UNSAFE_componentWillMount(): void
  • +

Accessors

  • get videoViewId(): number

Methods

  • UNSAFE_componentWillMount(): void
  • Called immediately before mounting occurs, and before Component#render. Avoid introducing any side-effects or subscriptions in this method.

    This method will not stop working in React 17.

    @@ -85,7 +85,7 @@ things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    -

    Parameters

    Returns any

  • render(): Element
  • setState<K>(state: null | {} | ((prevState: Readonly<{}>, props: Readonly<GroupCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void)): void
  • Type Parameters

    • K extends never

    Parameters

    • state: null | {} | ((prevState: Readonly<{}>, props: Readonly<GroupCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • shouldComponentUpdate(nextProps: Readonly<GroupCallVideoViewProps>, nextState: Readonly<{}>, nextContext: any): boolean
  • +

    Parameters

    Returns any

  • render(): Element
  • setState<K>(state: null | {} | ((prevState: Readonly<{}>, props: Readonly<GroupCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void)): void
  • Type Parameters

    • K extends never

    Parameters

    • state: null | {} | ((prevState: Readonly<{}>, props: Readonly<GroupCallVideoViewProps>) => null | {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • shouldComponentUpdate(nextProps: Readonly<GroupCallVideoViewProps>, nextState: Readonly<{}>, nextContext: any): boolean
onTouchCancel?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchEnd?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchEndCapture?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchMove?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchStart?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

participant?: Participant
pointerEvents?: "box-none" | "none" | "box-only" | "auto"
+

Parameters

  • event: GestureResponderEvent

Returns boolean

onTouchCancel?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchEnd?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchEndCapture?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchMove?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

onTouchStart?: ((event: GestureResponderEvent) => void)

Type declaration

    • (event: GestureResponderEvent): void
    • Parameters

      • event: GestureResponderEvent

      Returns void

participant?: Participant
pointerEvents?: "box-none" | "none" | "box-only" | "auto"

In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class:

.box-none { pointer-events: none; @@ -159,7 +159,7 @@

On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation.

-
resizeMode?: "contain" | "cover" | "center"
roomId?: string
shouldRasterizeIOS?: boolean
+
resizeMode?: "contain" | "cover" | "center"
roomId?: string
shouldRasterizeIOS?: boolean

Whether this view should be rendered as a bitmap before compositing.

On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view diff --git a/docs/interfaces/NativeCommonModule.html b/docs/interfaces/NativeCommonModule.html index cbb1d36..f30bab9 100644 --- a/docs/interfaces/NativeCommonModule.html +++ b/docs/interfaces/NativeCommonModule.html @@ -1,5 +1,5 @@ -NativeCommonModule | @sendbird/calls-react-native

Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

applicationId: string
currentUser: null | User

Methods

  • addDirectCallSound(type: SoundType, fileName: string): void
  • deauthenticate(): Promise<void>
  • getCurrentUser(): Promise<null | User>
  • handleFirebaseMessageData(data: Record<string, string>): void
  • initialize(appId: string): boolean
  • registerPushToken(token: string, unique?: boolean): Promise<void>
  • registerVoIPPushToken(token: string, unique?: boolean): Promise<void>
  • routePickerView(): void
  • setDirectCallDialingSoundOnWhenSilentOrVibrateMode(enabled: boolean): void
  • setLoggerLevel(level: "none" | "error" | "warning" | "info"): void
  • unregisterPushToken(token: string): Promise<void>
  • unregisterVoIPPushToken(token: string): Promise<void>
  • onCustomItemsDeleted(deletedKeys: string[]): void
  • Called when the custom items of the call are deleted.

    since

    1.0.0

    -

    Parameters

    • deletedKeys: string[]

    Returns void

  • onCustomItemsUpdated(updatedKeys: string[]): void
  • onCustomItemsUpdated(updatedKeys: string[]): void
  • Called when the custom items of the call are updated.

    since

    1.0.0

    -

    Parameters

    • updatedKeys: string[]

    Returns void

  • onDeleted(): void
  • onDeleted(): void
  • onLocalParticipantDisconnected(participant: Participant): void
  • onLocalParticipantDisconnected(participant: Participant): void
  • Called when the local participant's connection with the server has been interrupted.

    since

    1.1.0

    -

    Parameters

    Returns void

  • onLocalParticipantReconnected(participant: Participant): void
  • onLocalParticipantReconnected(participant: Participant): void
  • Called when the local participant's connection with the server has been established.

    since

    1.1.0

    -

    Parameters

    Returns void

  • onRemoteAudioSettingsChanged(participant: Participant): void
  • onRemoteAudioSettingsChanged(participant: Participant): void
  • onRemoteParticipantEntered(participant: Participant): void
  • onRemoteParticipantEntered(participant: Participant): void
  • onRemoteParticipantExited(participant: Participant): void
  • onRemoteParticipantExited(participant: Participant): void
  • onRemoteParticipantStreamStarted(participant: Participant): void
  • onRemoteParticipantStreamStarted(participant: Participant): void
  • onRemoteVideoSettingsChanged(participant: Participant): void
  • onRemoteVideoSettingsChanged(participant: Participant): void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Inherited method
  • Static property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/RoomProperties.html b/docs/interfaces/RoomProperties.html index d0eeec8..23ea1fa 100644 --- a/docs/interfaces/RoomProperties.html +++ b/docs/interfaces/RoomProperties.html @@ -1,36 +1,36 @@ -RoomProperties | @sendbird/calls-react-native
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RoomProperties

Implemented by

Index

Properties

android_availableAudioDevices: AudioDeviceType[]
+RoomProperties | @sendbird/calls-react-native
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RoomProperties

Implemented by

Index

Properties

android_availableAudioDevices: AudioDeviceType[]

Gets available audio devices.

platform

Android

since

1.0.0

-
android_currentAudioDevice: null | AudioDeviceType
+
android_currentAudioDevice: null | AudioDeviceType

Gets current audio device.

platform

Android

since

1.0.0

-
createdAt: number
+
createdAt: number

Gets createdAt that is a timestamp of creating the room.

since

1.0.0

-
createdBy: string
+
createdBy: string

Gets user ID created the room.

since

1.0.0

-
customItems: Record<string, string>
+
customItems: Record<string, string>

Gets custom items of this Room instance.

since

1.0.0

-
localParticipant: null | ParticipantProperties
+
localParticipant: null | ParticipantProperties

Gets the local participant.

since

1.0.0

-
participants: ParticipantProperties[]
+
participants: ParticipantProperties[]

Gets a list of participants who entered the room.

since

1.0.0

-
remoteParticipants: ParticipantProperties[]
+
remoteParticipants: ParticipantProperties[]

Gets a list of remote participants who entered the room.

since

1.0.0

-
roomId: string
+
roomId: string

Gets room ID.

since

1.0.0

-
state: RoomState
+
state: RoomState

Gets state of room.

since

1.0.0

-
type: RoomType
+
type: RoomType

Gets type of room.

since

1.0.0

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Inherited method
  • Static property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SendbirdCallListener.html b/docs/interfaces/SendbirdCallListener.html index c026e0f..5b29eee 100644 --- a/docs/interfaces/SendbirdCallListener.html +++ b/docs/interfaces/SendbirdCallListener.html @@ -1,4 +1,4 @@ -SendbirdCallListener | @sendbird/calls-react-native
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SendbirdCallListener

Index

Methods

Methods

  • +SendbirdCallListener | @sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SendbirdCallListener

    Index

    Methods

    Methods

    Legend

    • Constructor
    • Property
    • Method
    • Property
    • Method
    • Inherited constructor
    • Inherited method
    • Static property

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/SendbirdCallsJavascriptSpec.html b/docs/interfaces/SendbirdCallsJavascriptSpec.html index e98ca95..d918776 100644 --- a/docs/interfaces/SendbirdCallsJavascriptSpec.html +++ b/docs/interfaces/SendbirdCallsJavascriptSpec.html @@ -2,8 +2,8 @@

    Parameters

    • data: Record<string, string>

    Returns void

applicationId: string
authenticate: ((authParams: AuthenticateParams) => Promise<User>)

Type declaration

createRoom: ((roomParams: RoomParams) => Promise<RoomProperties>)

Type declaration

currentUser: null | User
deauthenticate: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

dial: ((calleeUserId: string, isVideoCall: boolean, options: CallOptions) => Promise<DirectCallProperties>)

Type declaration

fetchRoomById: ((roomId: string) => Promise<RoomProperties>)

Type declaration

getCachedRoomById: ((roomId: string) => Promise<null | RoomProperties>)

Type declaration

getCurrentUser: (() => Promise<null | User>)

Type declaration

    • (): Promise<null | User>
    • Returns Promise<null | User>

getDirectCall: ((callId: string) => Promise<DirectCallProperties>)

Type declaration

getOngoingCalls: (() => Promise<DirectCallProperties[]>)

Type declaration

initialize: ((appId: string) => boolean)

Type declaration

    • (appId: string): boolean
    • Parameters

      • appId: string

      Returns boolean

ios_registerVoIPPushToken: ((token: string, unique?: boolean) => Promise<void>)

Type declaration

    • (token: string, unique?: boolean): Promise<void>
    • platform

      iOS

      Parameters

      • token: string
      • Optional unique: boolean

      Returns Promise<void>

ios_routePickerView: (() => void)

Type declaration

    • (): void
    • platform

      iOS

      Returns void

ios_unregisterVoIPPushToken: ((token: string) => Promise<void>)

Type declaration

    • (token: string): Promise<void>
    • platform

      iOS

      -

      Parameters

      • token: string

      Returns Promise<void>

registerPushToken: ((token: string, unique?: boolean) => Promise<void>)

Type declaration

    • (token: string, unique?: boolean): Promise<void>
    • Parameters

      • token: string
      • Optional unique: boolean

      Returns Promise<void>

removeDirectCallSound: ((type: SoundType) => void)

Type declaration

setDirectCallDialingSoundOnWhenSilentOrVibrateMode: ((enabled: boolean) => void)

Type declaration

    • (enabled: boolean): void
    • Parameters

      • enabled: boolean

      Returns void

setLoggerLevel: ((level: "none" | "error" | "warning" | "info") => void)

Type declaration

    • (level: "none" | "error" | "warning" | "info"): void
    • Parameters

      • level: "none" | "error" | "warning" | "info"

      Returns void

unregisterPushToken: ((token: string) => Promise<void>)

Type declaration

    • (token: string): Promise<void>
    • Parameters

      • token: string

      Returns Promise<void>

Methods

registerPushToken: ((token: string, unique?: boolean) => Promise<void>)

Type declaration

    • (token: string, unique?: boolean): Promise<void>
    • Parameters

      • token: string
      • Optional unique: boolean

      Returns Promise<void>

removeDirectCallSound: ((type: SoundType) => void)

Type declaration

setDirectCallDialingSoundOnWhenSilentOrVibrateMode: ((enabled: boolean) => void)

Type declaration

    • (enabled: boolean): void
    • Parameters

      • enabled: boolean

      Returns void

setLoggerLevel: ((level: "none" | "error" | "warning" | "info") => void)

Type declaration

    • (level: "none" | "error" | "warning" | "info"): void
    • Parameters

      • level: "none" | "error" | "warning" | "info"

      Returns void

unregisterPushToken: ((token: string) => Promise<void>)

Type declaration

    • (token: string): Promise<void>
    • Parameters

      • token: string

      Returns Promise<void>

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SendbirdCallsNativeSpec.html b/docs/interfaces/SendbirdCallsNativeSpec.html index e40f952..f536072 100644 --- a/docs/interfaces/SendbirdCallsNativeSpec.html +++ b/docs/interfaces/SendbirdCallsNativeSpec.html @@ -1,16 +1,16 @@ -SendbirdCallsNativeSpec | @sendbird/calls-react-native
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SendbirdCallsNativeSpec

Hierarchy

Index

Properties

applicationId: string
createDirectCallLogListQuery: NativeQueryCreator<DirectCallLogQueryParams>
currentUser: null | User

Methods

  • accept(callId: string, options: CallOptions, holdActiveCall: boolean): Promise<void>
  • addDirectCallSound(type: SoundType, fileName: string): void
  • addListener(eventType: string): void
  • deauthenticate(): Promise<void>
  • end(callId: string): Promise<void>
  • enter(roomId: string, options: EnterParams): Promise<void>
  • exit(roomId: string): void
  • getConstants(): {}
  • Returns {}

    • getCurrentUser(): Promise<null | User>
    • handleFirebaseMessageData(data: Record<string, string>): void
    • initialize(appId: string): boolean
    • queryRelease(key: `native#${string}`): void
    • registerPushToken(token: string, unique?: boolean): Promise<void>
    • registerVoIPPushToken(token: string, unique?: boolean): Promise<void>
    • removeListeners(count: number): void
    • Remove a specified number of events. There are no eventTypes in this case, as the native side doesn't remove the name, but only manages a counter of total listeners

      Parameters

      • count: number

        number of listeners to remove (of any type)

        -

      Returns void

    • routePickerView(): void
    • setDirectCallDialingSoundOnWhenSilentOrVibrateMode(enabled: boolean): void
    • setLoggerLevel(level: "none" | "error" | "warning" | "info"): void
    • unregisterPushToken(token: string): Promise<void>
    • unregisterVoIPPushToken(token: string): Promise<void>
    • updateLocalVideoView(callId: string, videoViewId: number): void
    • updateRemoteVideoView(callId: string, videoViewId: number): void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/User.html b/docs/interfaces/User.html index 4b1ff75..1915bd2 100644 --- a/docs/interfaces/User.html +++ b/docs/interfaces/User.html @@ -1 +1 @@ -User | @sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Properties

    isActive: boolean
    metaData: Record<string, string>
    nickname: string
    profileUrl: string
    userId: string

    Generated using TypeDoc

    \ No newline at end of file +User | @sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Properties

    isActive: boolean
    metaData: Record<string, string>
    nickname: string
    profileUrl: string
    userId: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/VideoDevice.html b/docs/interfaces/VideoDevice.html index 5b4d68d..69bd718 100644 --- a/docs/interfaces/VideoDevice.html +++ b/docs/interfaces/VideoDevice.html @@ -1,5 +1,5 @@ -VideoDevice | @sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • VideoDevice

    Index

    Properties

    deviceId: string
    +VideoDevice | @sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • VideoDevice

    Index

    Properties

    deviceId: string

    device id

    android

    deviceName

    ios

    uniqueId

    -

    Legend

    • Constructor
    • Property
    • Method
    • Property
    • Method
    • Inherited constructor
    • Inherited method
    • Static property

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index fb6d287..ffdcaf0 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,12 +1,12 @@ -@sendbird/calls-react-native
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    @sendbird/calls-react-native

    Index

    Type Aliases

    AudioDevice: AudioDeviceType
    AudioDeviceChangedInfo: { data: { availableAudioDevices: AudioDevice[] | null; currentAudioDevice: AudioDevice | null }; platform: "android" } | { data: { currentRoute: AudioDeviceRoute; previousRoute: AudioDeviceRoute; reason: RouteChangeReason }; platform: "ios" }
    AudioDeviceRoute: { inputs: Port[]; outputs: Port[] }

    Type declaration

    CallOptions: { audioEnabled?: boolean; channelUrl?: string; frontCamera?: boolean; localVideoViewId?: number; remoteVideoViewId?: number; videoEnabled?: boolean }

    Type declaration

    JSMediaDeviceControl: AsJSMediaDeviceControl<NativeMediaDeviceControl>
    LocalParticipantMethods: JSLocalParticipantMediaDeviceControl
    NativeConstants: { NATIVE_SDK_VERSION: string }

    Type declaration

    • NATIVE_SDK_VERSION: string
    NativeQueryCreator<QueryParams>: ((params: QueryParams) => Promise<`native#${string}`>)

    Type Parameters

    • QueryParams

    Type declaration

      • (params: QueryParams): Promise<`native#${string}`>
      • Parameters

        • params: QueryParams

        Returns Promise<`native#${string}`>

    NativeQueryKey: `native#${string}`
    NativeQueryResult<T>: Promise<{ hasNext: boolean; result: T[] }>

    Type Parameters

    • T

    Port: { name: string; type: AVAudioSessionPort }

    Type declaration

    Range: { lowerBound?: number; upperBound?: number }

    Type declaration

    • Optional lowerBound?: number
    • Optional upperBound?: number
    RecordingOptions: { directoryPath: string; fileName?: string; recordingType: RecordingType }

    Type declaration

    • directoryPath: string

      Used to specify the base directory path of where the recorded file will be saved

    • Optional fileName?: string

      Used to specify a name of the recorded file. If unspecified, it will be saved as {type}_{callId}_{timestamp}.

      -
    • recordingType: RecordingType
    RoomListQueryParams: { createdAt?: Range; createdByUserIds?: string[]; currentParticipantCount?: Range; limit?: number; roomIds?: string[]; state?: RoomState; type?: RoomType }

    Type declaration

    • Optional createdAt?: Range
    • Optional createdByUserIds?: string[]
    • Optional currentParticipantCount?: Range
    • Optional limit?: number
    • Optional roomIds?: string[]
    • Optional state?: RoomState
    • Optional type?: RoomType
    RoomParams: { roomType: RoomType }

    Type declaration

    Variables

    Logger: { error: any; getLogLevel: any; info: any; setLogLevel: any; setTitle: any; warn: any } = ...

    Type declaration

    • error:function
      • error(...args: unknown[]): number
    • getLogLevel:function
      • getLogLevel(): "none" | "error" | "warning" | "info"
    • info:function
      • info(...args: unknown[]): number
    • setLogLevel:function
      • setLogLevel(lv: "none" | "error" | "warning" | "info"): void
    • setTitle:function
      • setTitle(title: string): void
    • warn:function
      • warn(...args: unknown[]): number
    SendbirdCalls: SendbirdCallsModule = ...

    Generated using TypeDoc

    \ No newline at end of file +
  • recordingType: RecordingType
  • RoomListQueryParams: { createdAt?: Range; createdByUserIds?: string[]; currentParticipantCount?: Range; limit?: number; roomIds?: string[]; state?: RoomState; type?: RoomType }

    Type declaration

    RoomParams: { roomType: RoomType }

    Type declaration

    Variables

    Logger: { error: any; getLogLevel: any; info: any; setLogLevel: any; setTitle: any; warn: any } = ...

    Type declaration

    • error:function
      • error(...args: unknown[]): number
    • getLogLevel:function
      • getLogLevel(): "none" | "error" | "warning" | "info"
    • info:function
      • info(...args: unknown[]): number
    • setLogLevel:function
      • setLogLevel(lv: "none" | "error" | "warning" | "info"): void
    • setTitle:function
      • setTitle(title: string): void
    • warn:function
      • warn(...args: unknown[]): number
    SendbirdCalls: SendbirdCallsModule = ...

    Generated using TypeDoc

    \ No newline at end of file diff --git a/package.json b/package.json index 35c99e4..89e614c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sendbird/calls-react-native", - "version": "1.1.0", + "version": "1.1.1", "description": "Sendbird Calls SDK for React Native: Empower React Native apps with seamless audio, video, and group calling. Build interactive communication easily.", "main": "lib/commonjs/index", "module": "lib/module/index", @@ -22,12 +22,13 @@ "!**/__mocks__" ], "scripts": { + "prepare": "yarn generate-version", "docs": "typedoc src/index.ts --excludeInternal --excludePrivate --excludeProtected", "test": "jest", "test:build": "yarn build && yarn clean", "test:tsc": "tsc --noEmit", "typescript": "tsc --noEmit", - "build": "bob build && node scripts/postbuild.js", + "build": "yarn generate-version && bob build", "clean": "del lib", "release": "release-it", "release:local": "npx yalc publish", @@ -43,7 +44,8 @@ "adb:reverse": "adb start-server && adb reverse tcp:8081 tcp:8081", "build:sample:android": "yarn sample build:android", "start:sample": "yarn sample start", - "icons": "node scripts/bundle-icons.js" + "icons": "node scripts/bundle-icons.js", + "generate-version": "node scripts/generate-version.js" }, "keywords": [ "react-native", @@ -84,6 +86,7 @@ "@types/react-native": "^0.67.8", "@typescript-eslint/eslint-plugin": "^5.19.0", "@typescript-eslint/parser": "^5.19.0", + "chalk": "4", "commitlint": "^11.0.0", "del-cli": "^4.0.1", "eslint": "^7.2.0", diff --git a/scripts/generate-version.js b/scripts/generate-version.js new file mode 100644 index 0000000..88eb0a9 --- /dev/null +++ b/scripts/generate-version.js @@ -0,0 +1,13 @@ +const chalk = require('chalk'); +const path = require('path'); +const fs = require('fs'); +const pkg = require('../package.json'); + +const fullPath = path.join(__dirname, '../', './src/version.ts'); +console.log(chalk.blue('📝 Generate @sendbird/calls-react-native version')); +console.log(chalk.blue(`📝 ${pkg.version} generate to ${fullPath}`)); + +const content = `const VERSION = '${pkg.version}'; +export default VERSION; +`; +fs.writeFileSync(fullPath, content, 'utf-8'); diff --git a/scripts/postbuild.js b/scripts/postbuild.js deleted file mode 100644 index d825ae8..0000000 --- a/scripts/postbuild.js +++ /dev/null @@ -1,3 +0,0 @@ -const fs = require('fs'); - -fs.writeFileSync('./lib/package.json', JSON.stringify({ version: require('../package.json').version }, null, 2)); diff --git a/src/libs/SendbirdCallsModule.tsx b/src/libs/SendbirdCallsModule.tsx index 5186119..e63fb99 100644 --- a/src/libs/SendbirdCallsModule.tsx +++ b/src/libs/SendbirdCallsModule.tsx @@ -1,6 +1,5 @@ import { Platform } from 'react-native'; -import pkg from '../../package.json'; import type { AuthenticateParams, CallOptions, @@ -14,6 +13,7 @@ import type { } from '../types'; import { NativeConstants, NativeQueryType, RoomState, RoomType, SoundType } from '../types'; import { Logger } from '../utils/logger'; +import Version from '../version'; import { DirectCallLogListQuery, RoomListQuery } from './BridgedQuery'; import { DirectCall } from './DirectCall'; import NativeBinder, { CallsEvent, DefaultEventType } from './NativeBinder'; @@ -36,7 +36,7 @@ export default class SendbirdCallsModule implements SendbirdCallsJavascriptSpec * @since 1.0.0 */ public get VERSION() { - return pkg.version; + return Version; } /** diff --git a/yarn.lock b/yarn.lock index 592d44e..5850391 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3228,18 +3228,18 @@ capture-exit@^2.0.0: dependencies: rsvp "^4.8.4" -chalk@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== +chalk@4, chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== +chalk@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0"