@daily-co/react-native-daily-js 0.69.0 → 0.70.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.70.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.73.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,7 @@ export interface DailyEventObjectAppMessage extends DailyEventObjectBase {
971
975
  export interface DailyEventObjectTranscriptionMessage
972
976
  extends DailyEventObjectBase {
973
977
  action: Extract<DailyEvent, 'transcription-message'>;
978
+ instanceId?: string;
974
979
  participantId: string;
975
980
  text: string;
976
981
  timestamp: Date;
@@ -1029,6 +1034,7 @@ export interface DailyEventObjectLiveStreamingStopped
1029
1034
  export interface DailyEventObjectTranscriptionStarted
1030
1035
  extends DailyEventObjectBase {
1031
1036
  action: Extract<DailyEvent, 'transcription-started'>;
1037
+ instanceId: string;
1032
1038
  transcriptId?: string;
1033
1039
  language: string;
1034
1040
  model: string;
@@ -1045,12 +1051,14 @@ export interface DailyEventObjectTranscriptionStarted
1045
1051
  export interface DailyEventObjectTranscriptionStopped
1046
1052
  extends DailyEventObjectBase {
1047
1053
  action: Extract<DailyEvent, 'transcription-stopped'>;
1054
+ instanceId: string;
1048
1055
  updatedBy: string;
1049
1056
  }
1050
1057
 
1051
1058
  export interface DailyEventObjectTranscriptionError
1052
1059
  extends DailyEventObjectBase {
1053
1060
  action: Extract<DailyEvent, 'transcription-error'>;
1061
+ instanceId: string;
1054
1062
  errorMsg?: string;
1055
1063
  }
1056
1064
  export interface DailyEventObjectRemoteMediaPlayerUpdate
@@ -1073,6 +1081,8 @@ export interface DailyEventObjectRemoteMediaPlayerStopped
1073
1081
  }
1074
1082
  export interface DailyEventObjectDialinConnected extends DailyEventObjectBase {
1075
1083
  action: Extract<DailyEvent, 'dialin-connected'>;
1084
+ sipHeaders?: Record<string, any>;
1085
+ sipFrom?: string;
1076
1086
  actionTraceId?: string;
1077
1087
  }
1078
1088
 
@@ -1084,6 +1094,8 @@ export interface DailyEventObjectDialinError extends DailyEventObjectBase {
1084
1094
 
1085
1095
  export interface DailyEventObjectDialinStopped extends DailyEventObjectBase {
1086
1096
  action: Extract<DailyEvent, 'dialin-stopped'>;
1097
+ sipHeaders?: Record<string, any>;
1098
+ sipFrom?: string;
1087
1099
  actionTraceId?: string;
1088
1100
  }
1089
1101
 
@@ -1419,6 +1431,17 @@ export interface DailyTranscriptionDeepgramOptions {
1419
1431
  punctuate?: boolean;
1420
1432
  extra?: Record<string, any>;
1421
1433
  includeRawResponse?: boolean;
1434
+ instanceId?: string;
1435
+ participants?: Array<string>;
1436
+ }
1437
+
1438
+ export interface DailyTranscriptionUpdateOptions {
1439
+ instanceId?: string;
1440
+ participants: Array<string>;
1441
+ }
1442
+
1443
+ export interface DailyTranscriptionStopOptions {
1444
+ instanceId?: string;
1422
1445
  }
1423
1446
 
1424
1447
  export type DailyDialOutAudioCodecs = 'PCMU' | 'OPUS' | 'G722' | 'PCMA';
@@ -1454,6 +1477,16 @@ export type DailyStartDialoutOptions =
1454
1477
  | DailyStartDialoutSipOptions
1455
1478
  | DailyStartDialoutPhoneOptions;
1456
1479
 
1480
+ export interface DailySipCallTransferOptions {
1481
+ sessionId: string;
1482
+ toEndPoint: string;
1483
+ }
1484
+
1485
+ export interface DailySipReferOptions {
1486
+ sessionId: string;
1487
+ toEndPoint: string;
1488
+ }
1489
+
1457
1490
  export interface DailyCall {
1458
1491
  callClientId: string;
1459
1492
  join(properties?: DailyCallOptions): Promise<DailyParticipantsObject | void>;
@@ -1549,7 +1582,8 @@ export interface DailyCall {
1549
1582
  options: DailyRemoteMediaPlayerUpdateOptions
1550
1583
  ): Promise<DailyRemoteMediaPlayerInfo>;
1551
1584
  startTranscription(options?: DailyTranscriptionDeepgramOptions): void;
1552
- stopTranscription(): void;
1585
+ updateTranscription(options: DailyTranscriptionUpdateOptions): void;
1586
+ stopTranscription(options?: DailyTranscriptionStopOptions): void;
1553
1587
  preAuth(properties?: DailyCallOptions): Promise<{ access: DailyAccess }>;
1554
1588
  load(properties?: DailyLoadOptions): Promise<void>;
1555
1589
  startScreenShare(properties?: DailyStartScreenShare): void;
@@ -1607,6 +1641,8 @@ export interface DailyCall {
1607
1641
  ): Promise<{ session?: DailyDialOutSession }>;
1608
1642
  stopDialOut(options: { sessionId: string }): Promise<void>;
1609
1643
  sendDTMF(options: { sessionId: string; tones: string }): Promise<void>;
1644
+ sipCallTransfer(options: DailySipCallTransferOptions): Promise<void>;
1645
+ sipRefer(options: DailySipReferOptions): Promise<void>;
1610
1646
  }
1611
1647
 
1612
1648
  declare const Daily: DailyCallFactory & DailyCallStaticUtils;