@daily-co/react-native-daily-js 0.69.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,9 @@ package com.daily.reactlibrary;
2
2
 
3
3
  import android.Manifest;
4
4
  import android.app.Activity;
5
+ import android.content.Context;
5
6
  import android.content.Intent;
7
+ import android.content.pm.PackageInfo;
6
8
  import android.content.pm.PackageManager;
7
9
  import android.os.Build;
8
10
  import android.os.Process;
@@ -129,10 +131,33 @@ public class DailyNativeUtils extends ReactContextBaseJavaModule implements Perm
129
131
  return true;
130
132
  }
131
133
 
134
+ private List<String> getDeclaredPermissions(Context context) {
135
+ List<String> declaredPermissions = new ArrayList<>();
136
+ try {
137
+ PackageInfo packageInfo = context.getPackageManager().getPackageInfo(
138
+ context.getPackageName(),
139
+ PackageManager.GET_PERMISSIONS
140
+ );
141
+ // Check if permissions are requested
142
+ if (packageInfo.requestedPermissions != null) {
143
+ declaredPermissions = Arrays.asList(packageInfo.requestedPermissions);
144
+ }
145
+ } catch (PackageManager.NameNotFoundException e) {
146
+ e.printStackTrace();
147
+ }
148
+ return declaredPermissions;
149
+ }
150
+
132
151
  private void checkPermissions() {
152
+ Context applicationContext = this.reactContext.getApplicationContext();
153
+ List<String> declaredPermissions = this.getDeclaredPermissions(applicationContext);
133
154
  List<String> permissionList = new ArrayList<String>();
134
- permissionList.add(Manifest.permission.CAMERA);
135
- permissionList.add(Manifest.permission.RECORD_AUDIO);
155
+ if (declaredPermissions.contains(Manifest.permission.FOREGROUND_SERVICE_CAMERA)) {
156
+ permissionList.add(Manifest.permission.CAMERA);
157
+ }
158
+ if (declaredPermissions.contains(Manifest.permission.FOREGROUND_SERVICE_MICROPHONE)) {
159
+ permissionList.add(Manifest.permission.RECORD_AUDIO);
160
+ }
136
161
  if (Build.VERSION.SDK_INT >= 33) {
137
162
  permissionList.add(Manifest.permission.POST_NOTIFICATIONS);
138
163
  }
package/dist/index.js CHANGED
@@ -105,6 +105,7 @@ function setupGlobals() {
105
105
  (0, react_native_webrtc_1.registerGlobals)();
106
106
  // A shim to prevent errors in call machine bundle (not ideal)
107
107
  global.window.addEventListener = function () { };
108
+ global.window.removeEventListener = function () { };
108
109
  global.btoa = base_64_1.encode;
109
110
  global.atob = base_64_1.decode;
110
111
  // A workaround for iOS HTTP cache not caching call object bundle due to size
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "version": "0.69.0",
3
+ "version": "0.71.0",
4
4
  "description": "React Native library for making video calls using Daily",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
29
29
  },
30
30
  "dependencies": {
31
- "@daily-co/daily-js": "^0.71.2",
31
+ "@daily-co/daily-js": "^0.74.0",
32
32
  "@types/react-native-background-timer": "^2.0.0",
33
33
  "base-64": "^1.0.0",
34
34
  "react-native-url-polyfill": "^1.1.2"
@@ -91,6 +91,7 @@ export type DailyEvent =
91
91
  | 'local-audio-level'
92
92
  | 'remote-participants-audio-level'
93
93
  | 'dialin-connected'
94
+ | 'dialin-ready'
94
95
  | 'dialin-error'
95
96
  | 'dialin-stopped'
96
97
  | 'dialin-warning'
@@ -207,6 +208,9 @@ export interface DailyAdvancedConfig {
207
208
  * @deprecated This property will be removed. Instead, use sendSettings, which is found in DailyCallOptions.
208
209
  */
209
210
  camSimulcastEncodings?: CamSimulcastEncoding[];
211
+ /**
212
+ * @deprecated This property will be removed. All calls use v2CamAndMic.
213
+ */
210
214
  v2CamAndMic?: boolean;
211
215
  micAudioMode?: 'music' | 'speech';
212
216
  userMediaAudioConstraints?: MediaTrackConstraints;
@@ -971,6 +975,8 @@ export interface DailyEventObjectAppMessage extends DailyEventObjectBase {
971
975
  export interface DailyEventObjectTranscriptionMessage
972
976
  extends DailyEventObjectBase {
973
977
  action: Extract<DailyEvent, 'transcription-message'>;
978
+ instanceId?: string;
979
+ trackType?: 'cam-audio' | 'screen-audio' | 'rmpAudio' | string;
974
980
  participantId: string;
975
981
  text: string;
976
982
  timestamp: Date;
@@ -1029,6 +1035,7 @@ export interface DailyEventObjectLiveStreamingStopped
1029
1035
  export interface DailyEventObjectTranscriptionStarted
1030
1036
  extends DailyEventObjectBase {
1031
1037
  action: Extract<DailyEvent, 'transcription-started'>;
1038
+ instanceId: string;
1032
1039
  transcriptId?: string;
1033
1040
  language: string;
1034
1041
  model: string;
@@ -1045,12 +1052,14 @@ export interface DailyEventObjectTranscriptionStarted
1045
1052
  export interface DailyEventObjectTranscriptionStopped
1046
1053
  extends DailyEventObjectBase {
1047
1054
  action: Extract<DailyEvent, 'transcription-stopped'>;
1055
+ instanceId: string;
1048
1056
  updatedBy: string;
1049
1057
  }
1050
1058
 
1051
1059
  export interface DailyEventObjectTranscriptionError
1052
1060
  extends DailyEventObjectBase {
1053
1061
  action: Extract<DailyEvent, 'transcription-error'>;
1062
+ instanceId: string;
1054
1063
  errorMsg?: string;
1055
1064
  }
1056
1065
  export interface DailyEventObjectRemoteMediaPlayerUpdate
@@ -1073,6 +1082,8 @@ export interface DailyEventObjectRemoteMediaPlayerStopped
1073
1082
  }
1074
1083
  export interface DailyEventObjectDialinConnected extends DailyEventObjectBase {
1075
1084
  action: Extract<DailyEvent, 'dialin-connected'>;
1085
+ sipHeaders?: Record<string, any>;
1086
+ sipFrom?: string;
1076
1087
  actionTraceId?: string;
1077
1088
  }
1078
1089
 
@@ -1084,6 +1095,8 @@ export interface DailyEventObjectDialinError extends DailyEventObjectBase {
1084
1095
 
1085
1096
  export interface DailyEventObjectDialinStopped extends DailyEventObjectBase {
1086
1097
  action: Extract<DailyEvent, 'dialin-stopped'>;
1098
+ sipHeaders?: Record<string, any>;
1099
+ sipFrom?: string;
1087
1100
  actionTraceId?: string;
1088
1101
  }
1089
1102
 
@@ -1419,6 +1432,17 @@ export interface DailyTranscriptionDeepgramOptions {
1419
1432
  punctuate?: boolean;
1420
1433
  extra?: Record<string, any>;
1421
1434
  includeRawResponse?: boolean;
1435
+ instanceId?: string;
1436
+ participants?: Array<string>;
1437
+ }
1438
+
1439
+ export interface DailyTranscriptionUpdateOptions {
1440
+ instanceId?: string;
1441
+ participants: Array<string>;
1442
+ }
1443
+
1444
+ export interface DailyTranscriptionStopOptions {
1445
+ instanceId?: string;
1422
1446
  }
1423
1447
 
1424
1448
  export type DailyDialOutAudioCodecs = 'PCMU' | 'OPUS' | 'G722' | 'PCMA';
@@ -1454,6 +1478,16 @@ export type DailyStartDialoutOptions =
1454
1478
  | DailyStartDialoutSipOptions
1455
1479
  | DailyStartDialoutPhoneOptions;
1456
1480
 
1481
+ export interface DailySipCallTransferOptions {
1482
+ sessionId: string;
1483
+ toEndPoint: string;
1484
+ }
1485
+
1486
+ export interface DailySipReferOptions {
1487
+ sessionId: string;
1488
+ toEndPoint: string;
1489
+ }
1490
+
1457
1491
  export interface DailyCall {
1458
1492
  callClientId: string;
1459
1493
  join(properties?: DailyCallOptions): Promise<DailyParticipantsObject | void>;
@@ -1549,7 +1583,8 @@ export interface DailyCall {
1549
1583
  options: DailyRemoteMediaPlayerUpdateOptions
1550
1584
  ): Promise<DailyRemoteMediaPlayerInfo>;
1551
1585
  startTranscription(options?: DailyTranscriptionDeepgramOptions): void;
1552
- stopTranscription(): void;
1586
+ updateTranscription(options: DailyTranscriptionUpdateOptions): void;
1587
+ stopTranscription(options?: DailyTranscriptionStopOptions): void;
1553
1588
  preAuth(properties?: DailyCallOptions): Promise<{ access: DailyAccess }>;
1554
1589
  load(properties?: DailyLoadOptions): Promise<void>;
1555
1590
  startScreenShare(properties?: DailyStartScreenShare): void;
@@ -1607,6 +1642,8 @@ export interface DailyCall {
1607
1642
  ): Promise<{ session?: DailyDialOutSession }>;
1608
1643
  stopDialOut(options: { sessionId: string }): Promise<void>;
1609
1644
  sendDTMF(options: { sessionId: string; tones: string }): Promise<void>;
1645
+ sipCallTransfer(options: DailySipCallTransferOptions): Promise<void>;
1646
+ sipRefer(options: DailySipReferOptions): Promise<void>;
1610
1647
  }
1611
1648
 
1612
1649
  declare const Daily: DailyCallFactory & DailyCallStaticUtils;