@cloudflare/realtimekit-react-native 0.1.2 → 0.1.3-staging.2

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.
Files changed (60) hide show
  1. package/android/src/main/AndroidManifest.xml +8 -1
  2. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/BackgroundTimer/RNBackgroundTimer.java +3 -3
  3. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/Constants.java +4 -4
  4. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/CoreModule.java +1 -1
  5. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/CorePackage.java +6 -6
  6. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/ForegroundService.java +5 -5
  7. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/NotificationHelper.java +2 -2
  8. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/RNPermissionsModule.java +2 -2
  9. package/android/src/main/java/com/{reactnativecore/DyteHelperModule.java → cloudflare/realtimekit/RTKHelperModule.java} +12 -12
  10. package/android/src/main/java/com/{reactnativecore/DyteHolder.java → cloudflare/realtimekit/RTKHolder.java} +2 -2
  11. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/AppRTCBluetoothManager.java +4 -4
  12. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/AppRTCProximitySensor.java +4 -4
  13. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/AppRTCUtils.java +1 -1
  14. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/InCallManagerModule.java +4 -4
  15. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/InCallProximityManager.java +3 -3
  16. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/InCallWakeLockUtils.java +2 -2
  17. package/android/src/main/java/com/{reactnativecore → cloudflare/realtimekit}/incallmanager/ThreadUtils.java +1 -1
  18. package/android/src/main/res/values/strings.xml +3 -0
  19. package/app.plugin.js +1 -1
  20. package/ios/{DyteRNBackgroundTimer.h → RTKRNBackgroundTimer.h} +1 -1
  21. package/ios/{DyteRNBackgroundTimer.m → RTKRNBackgroundTimer.m} +10 -9
  22. package/ios/{DyteRNPermissionHandlerNotifications.h → RTKRNPermissionHandlerNotifications.h} +2 -2
  23. package/ios/{DyteRNPermissionHandlerNotifications.m → RTKRNPermissionHandlerNotifications.m} +3 -3
  24. package/ios/{DyteRNPermissions.h → RTKRNPermissions.h} +2 -2
  25. package/ios/{DyteRNPermissions.m → RTKRNPermissions.m} +33 -33
  26. package/ios/{DyteScreensharePickerView.h → RTKScreensharePickerView.h} +1 -1
  27. package/ios/{DyteScreensharePickerView.m → RTKScreensharePickerView.m} +2 -2
  28. package/ios/permissions/RTKRNPermissionHandlerBluetoothPeripheral.h +4 -0
  29. package/ios/permissions/{DyteRNPermissionHandlerBluetoothPeripheral.m → RTKRNPermissionHandlerBluetoothPeripheral.m} +3 -3
  30. package/ios/permissions/RTKRNPermissionHandlerCamera.h +5 -0
  31. package/ios/permissions/{DyteRNPermissionHandlerCamera.m → RTKRNPermissionHandlerCamera.m} +2 -2
  32. package/ios/permissions/RTKRNPermissionHandlerMicrophone.h +5 -0
  33. package/ios/permissions/{DyteRNPermissionHandlerMicrophone.m → RTKRNPermissionHandlerMicrophone.m} +2 -2
  34. package/ios/permissions/{DyteRNPermissionHandlerPhotoLibrary.h → RTKRNPermissionHandlerPhotoLibrary.h} +2 -2
  35. package/ios/permissions/{DyteRNPermissionHandlerPhotoLibrary.m → RTKRNPermissionHandlerPhotoLibrary.m} +2 -2
  36. package/ios/screenshare/{DyteDarwinNotificationCenter.swift → RTKDarwinNotificationCenter.swift} +4 -4
  37. package/ios/screenshare/{DyteScreenshareAtomic.swift → RTKScreenshareAtomic.swift} +1 -1
  38. package/ios/screenshare/{DyteScreenshareHandler.swift → RTKScreenshareHandler.swift} +8 -8
  39. package/ios/screenshare/{DyteScreenshareUploader.swift → RTKScreenshareUploader.swift} +6 -6
  40. package/ios/screenshare/{DyteSocketConnection.swift → RTKSocketConnection.swift} +3 -3
  41. package/lib/AudioSampleHandler.d.ts +14 -0
  42. package/lib/AudioSampleHandler.js +57 -0
  43. package/lib/BackgroundHandler.d.ts +1 -0
  44. package/lib/BackgroundHandler.js +17 -14
  45. package/lib/LocalMediaHandler.js +9 -9
  46. package/lib/PermissionHandler.js +7 -7
  47. package/lib/ReactContext.d.ts +4 -4
  48. package/lib/ReactContext.js +5 -5
  49. package/lib/ReactHooks.d.ts +1 -1
  50. package/lib/ReactHooks.js +1 -1
  51. package/lib/index.js +12 -0
  52. package/package.json +4 -6
  53. package/plugin/build/{withDyte.js → withRTK.js} +1 -1
  54. package/plugin/src/{withDyte.ts → withRTK.ts} +4 -1
  55. package/plugin/tsconfig.tsbuildinfo +1 -1
  56. package/LICENSE +0 -13
  57. package/ios/permissions/DyteRNPermissionHandlerBluetoothPeripheral.h +0 -4
  58. package/ios/permissions/DyteRNPermissionHandlerCamera.h +0 -5
  59. package/ios/permissions/DyteRNPermissionHandlerMicrophone.h +0 -5
  60. /package/plugin/build/{withDyte.d.ts → withRTK.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativecore">
2
+ package="com.cloudflare.realtimekit">
3
3
  <uses-feature android:name="android.hardware.camera" />
4
4
  <uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
5
5
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@@ -21,4 +21,11 @@
21
21
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
22
22
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
23
23
  <uses-permission android:name="android.permission.MICROPHONE" />
24
+ <application>
25
+ <provider
26
+ android:name="com.facebook.react.modules.blob.BlobProvider"
27
+ android:authorities="@string/blob_provider_authority"
28
+ android:exported="false"
29
+ />
30
+ </application>
24
31
  </manifest>
@@ -1,4 +1,4 @@
1
- package com.reactnativecore.BackgroundTimer;
1
+ package com.cloudflare.realtimekit.BackgroundTimer;
2
2
 
3
3
  import android.os.Handler;
4
4
  import android.os.PowerManager;
@@ -40,13 +40,13 @@ public class RNBackgroundTimer extends ReactContextBaseJavaModule {
40
40
  super(reactContext);
41
41
  this.reactContext = reactContext;
42
42
  this.powerManager = (PowerManager) getReactApplicationContext().getSystemService(reactContext.POWER_SERVICE);
43
- this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "dytesdk:wakelock");
43
+ this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "realtimekit:wakelock");
44
44
  reactContext.addLifecycleEventListener(listener);
45
45
  }
46
46
 
47
47
  @Override
48
48
  public String getName() {
49
- return "DyteRNBackgroundTimer";
49
+ return "RTKRNBackgroundTimer";
50
50
  }
51
51
 
52
52
 
@@ -1,11 +1,11 @@
1
1
 
2
- package com.reactnativecore;
2
+ package com.cloudflare.realtimekit;
3
3
 
4
4
  class Constants {
5
- static final String ACTION_FOREGROUND_SERVICE_START = "package com.dyteMobileSdk.service_start";
6
- static final String ACTION_FOREGROUND_SERVICE_STOP = "package com.dyteMobileSdk.service_stop";
5
+ static final String ACTION_FOREGROUND_SERVICE_START = "package com.cloudflare.realtimekit.service_start";
6
+ static final String ACTION_FOREGROUND_SERVICE_STOP = "package com.cloudflare.realtimekit.service_stop";
7
7
 
8
- static final String NOTIFICATION_CONFIG = "package com.dyteMobileSdk.notif_config";
8
+ static final String NOTIFICATION_CONFIG = "package com.cloudflare.realtimekit.notif_config";
9
9
 
10
10
  static final String ERROR_INVALID_CONFIG = "ERROR_INVALID_CONFIG";
11
11
  static final String ERROR_SERVICE_ERROR = "ERROR_SERVICE_ERROR";
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.util.Base64;
4
4
 
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import androidx.annotation.NonNull;
4
4
 
@@ -9,10 +9,10 @@ import com.facebook.react.uimanager.ViewManager;
9
9
 
10
10
  import java.util.*;
11
11
 
12
- import com.reactnativecore.incallmanager.InCallManagerModule;
13
- import com.reactnativecore.RNPermissionsModule;
14
- import com.reactnativecore.BackgroundTimer.RNBackgroundTimer;
15
- import com.reactnativecore.DyteHelperModule;
12
+ import com.cloudflare.realtimekit.incallmanager.InCallManagerModule;
13
+ import com.cloudflare.realtimekit.RNPermissionsModule;
14
+ import com.cloudflare.realtimekit.BackgroundTimer.RNBackgroundTimer;
15
+ import com.cloudflare.realtimekit.RTKHelperModule;
16
16
 
17
17
  public class CorePackage implements ReactPackage {
18
18
  @NonNull
@@ -22,7 +22,7 @@ public class CorePackage implements ReactPackage {
22
22
  new RNPermissionsModule(reactContext),
23
23
  new InCallManagerModule(reactContext),
24
24
  new RNBackgroundTimer(reactContext),
25
- new DyteHelperModule(reactContext)
25
+ new RTKHelperModule(reactContext)
26
26
  );
27
27
  }
28
28
 
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.app.Notification;
4
4
  import android.app.Service;
@@ -10,7 +10,7 @@ import android.os.IBinder;
10
10
  import android.util.Log;
11
11
  import android.app.Activity;
12
12
  import android.widget.Toast;
13
- import com.reactnativecore.DyteHolder;
13
+ import com.cloudflare.realtimekit.RTKHolder;
14
14
 
15
15
  public class ForegroundService extends Service {
16
16
  @Override
@@ -22,9 +22,9 @@ public class ForegroundService extends Service {
22
22
  String action = intent.getAction();
23
23
  if (action != null) {
24
24
  if (action.equals(Constants.ACTION_FOREGROUND_SERVICE_START)) {
25
- if(DyteHolder.currActivity!=null) {
26
- NotificationHelper notificationHelper = NotificationHelper.getInstance(DyteHolder.currActivity);
27
- Notification notification = notificationHelper.buildNotification(DyteHolder.currActivity);
25
+ if(RTKHolder.currActivity!=null) {
26
+ NotificationHelper notificationHelper = NotificationHelper.getInstance(RTKHolder.currActivity);
27
+ Notification notification = notificationHelper.buildNotification(RTKHolder.currActivity);
28
28
  if (notification != null) {
29
29
  try {
30
30
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.app.Notification;
4
4
  import android.app.NotificationChannel;
@@ -51,7 +51,7 @@ class NotificationHelper {
51
51
  mNotificationManager.createNotificationChannel(channel);
52
52
  promise.resolve(null);
53
53
  } else {
54
- promise.reject(Constants.ERROR_ANDROID_VERSION, "DyteForegroundService: Notification channel can be created on Android O+");
54
+ promise.reject(Constants.ERROR_ANDROID_VERSION, "RTKForegroundService: Notification channel can be created on Android O+");
55
55
  }
56
56
  }
57
57
 
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.Manifest;
4
4
  import android.app.Activity;
@@ -55,7 +55,7 @@ public class RNPermissionsModule extends ReactContextBaseJavaModule implements P
55
55
 
56
56
  @Override
57
57
  public String getName() {
58
- return "DyteRNPermissions";
58
+ return "RTKRNPermissions";
59
59
  }
60
60
 
61
61
 
@@ -1,4 +1,4 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.app.ActivityManager;
@@ -12,7 +12,7 @@ import android.os.PowerManager;
12
12
  import android.util.Log;
13
13
  import android.view.WindowManager;
14
14
 
15
- import com.reactnativecore.ForegroundService;
15
+ import com.cloudflare.realtimekit.ForegroundService;
16
16
  import com.facebook.react.bridge.Callback;
17
17
  import com.facebook.react.bridge.LifecycleEventListener;
18
18
  import com.facebook.react.bridge.Promise;
@@ -27,10 +27,10 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
27
27
  import java.io.Serializable;
28
28
  import java.util.HashMap;
29
29
 
30
- import com.reactnativecore.DyteHolder;
30
+ import com.cloudflare.realtimekit.RTKHolder;
31
31
 
32
- @ReactModule(name = "DyteHelperModule")
33
- public class DyteHelperModule extends ReactContextBaseJavaModule {
32
+ @ReactModule(name = "RTKHelperModule")
33
+ public class RTKHelperModule extends ReactContextBaseJavaModule {
34
34
 
35
35
  private final ReactApplicationContext reactContext;
36
36
  private static final String ERROR_INVALID_ACTIVITY = "E_INVALID_ACTIVITY";
@@ -74,17 +74,17 @@ public class DyteHelperModule extends ReactContextBaseJavaModule {
74
74
  }
75
75
  }
76
76
 
77
- public DyteHelperModule(ReactApplicationContext reactContext) {
77
+ public RTKHelperModule(ReactApplicationContext reactContext) {
78
78
  super(reactContext);
79
79
  this.reactContext = reactContext;
80
80
  this.powerManager = (PowerManager) getReactApplicationContext().getSystemService(reactContext.POWER_SERVICE);
81
- this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "dytesdk:wakelock");
81
+ this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "realtimekit:wakelock");
82
82
  reactContext.addLifecycleEventListener(listener);
83
83
  }
84
84
 
85
85
  @Override
86
86
  public String getName() {
87
- return "DyteHelper";
87
+ return "RTKHelper";
88
88
  }
89
89
 
90
90
  @ReactMethod
@@ -95,7 +95,7 @@ public class DyteHelperModule extends ReactContextBaseJavaModule {
95
95
  @ReactMethod
96
96
  public void startService(Promise promise) {
97
97
  ComponentName mediaService;
98
- DyteHolder.currActivity = this.getCurrentActivity();
98
+ RTKHolder.currActivity = this.getCurrentActivity();
99
99
  Intent intent = new Intent(getReactApplicationContext(), ForegroundService.class);
100
100
  intent.setAction(Constants.ACTION_FOREGROUND_SERVICE_START);
101
101
  try{
@@ -107,13 +107,13 @@ public class DyteHelperModule extends ReactContextBaseJavaModule {
107
107
  } catch (RuntimeException e) {
108
108
  // Avoid crashing due to ForegroundServiceStartNotAllowedException (API level 31).
109
109
  // See: https://developer.android.com/guide/components/foreground-services#background-start-restrictions
110
- Log.w("DyteHelperModule", "Media projection service not started", e);
110
+ Log.w("RTKHelperModule", "Media projection service not started", e);
111
111
  return;
112
112
  }
113
113
  if (mediaService != null) {
114
114
  promise.resolve(null);
115
115
  } else {
116
- promise.reject(Constants.ERROR_SERVICE_ERROR, "DyteForegroundService: Foreground service is not started");
116
+ promise.reject(Constants.ERROR_SERVICE_ERROR, "RTKForegroundService: Foreground service is not started");
117
117
  }
118
118
  }
119
119
 
@@ -125,7 +125,7 @@ public class DyteHelperModule extends ReactContextBaseJavaModule {
125
125
  if (stopped) {
126
126
  promise.resolve(null);
127
127
  } else {
128
- promise.reject(Constants.ERROR_SERVICE_ERROR, "DyteForegroundService: Foreground service failed to stop");
128
+ promise.reject(Constants.ERROR_SERVICE_ERROR, "RTKForegroundService: Foreground service failed to stop");
129
129
  }
130
130
  }
131
131
  @ReactMethod
@@ -1,7 +1,7 @@
1
- package com.reactnativecore;
1
+ package com.cloudflare.realtimekit;
2
2
 
3
3
  import android.app.Activity;
4
4
 
5
- public class DyteHolder {
5
+ public class RTKHolder {
6
6
  public static Activity currActivity;
7
7
  }
@@ -7,7 +7,7 @@
7
7
  * in the file PATENTS. All contributing project authors may
8
8
  * be found in the AUTHORS file in the root of the source tree.
9
9
  */
10
- package com.reactnativecore.incallmanager;
10
+ package com.cloudflare.realtimekit.incallmanager;
11
11
  import android.annotation.SuppressLint;
12
12
  import android.bluetooth.BluetoothClass;
13
13
  import android.bluetooth.BluetoothAdapter;
@@ -33,9 +33,9 @@ import androidx.annotation.RequiresApi;
33
33
  import java.util.List;
34
34
  import java.util.Set;
35
35
  import java.util.ArrayList;
36
- import com.reactnativecore.incallmanager.AppRTCUtils;
37
- import com.reactnativecore.incallmanager.ThreadUtils;
38
- import com.reactnativecore.incallmanager.InCallManagerModule;
36
+ import com.cloudflare.realtimekit.incallmanager.AppRTCUtils;
37
+ import com.cloudflare.realtimekit.incallmanager.ThreadUtils;
38
+ import com.cloudflare.realtimekit.incallmanager.InCallManagerModule;
39
39
  /**
40
40
  * AppRTCProximitySensor manages functions related to Bluetoth devices in the
41
41
  * AppRTC demo.
@@ -7,7 +7,7 @@
7
7
  * in the file PATENTS. All contributing project authors may
8
8
  * be found in the AUTHORS file in the root of the source tree.
9
9
  */
10
- package com.reactnativecore.incallmanager;
10
+ package com.cloudflare.realtimekit.incallmanager;
11
11
  import android.content.Context;
12
12
  import android.hardware.Sensor;
13
13
  import android.hardware.SensorEvent;
@@ -16,8 +16,8 @@ import android.hardware.SensorManager;
16
16
  import android.os.Build;
17
17
  import android.util.Log;
18
18
  import androidx.annotation.Nullable;
19
- import com.reactnativecore.incallmanager.AppRTCUtils;
20
- import com.reactnativecore.incallmanager.ThreadUtils;
19
+ import com.cloudflare.realtimekit.incallmanager.AppRTCUtils;
20
+ import com.cloudflare.realtimekit.incallmanager.ThreadUtils;
21
21
  /**
22
22
  * AppRTCProximitySensor manages functions related to the proximity sensor in
23
23
  * the AppRTC demo.
@@ -28,7 +28,7 @@ import com.reactnativecore.incallmanager.ThreadUtils;
28
28
  * Anything less than the threshold value and the sensor returns "NEAR".
29
29
  */
30
30
  public class AppRTCProximitySensor implements SensorEventListener {
31
- private static final String TAG = "dytesdk:AppRTCProximity";
31
+ private static final String TAG = "realtimekit:AppRTCProximity";
32
32
  // This class should be created, started and stopped on one thread
33
33
  // (e.g. the main thread). We use `nonThreadSafe` to ensure that this is
34
34
  // the case. Only active when `DEBUG` is set to true.
@@ -7,7 +7,7 @@
7
7
  * in the file PATENTS. All contributing project authors may
8
8
  * be found in the AUTHORS file in the root of the source tree.
9
9
  */
10
- package com.reactnativecore.incallmanager;
10
+ package com.cloudflare.realtimekit.incallmanager;
11
11
  import android.os.Build;
12
12
  import android.util.Log;
13
13
  /**
@@ -1,4 +1,4 @@
1
- package com.reactnativecore.incallmanager;
1
+ package com.cloudflare.realtimekit.incallmanager;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.content.Context;
@@ -50,13 +50,13 @@ import java.util.Random;
50
50
  import java.util.Set;
51
51
  import java.util.List;
52
52
 
53
- import com.reactnativecore.incallmanager.AppRTCBluetoothManager;
54
- import com.reactnativecore.incallmanager.InCallManagerModule.AudioDevice;
53
+ import com.cloudflare.realtimekit.incallmanager.AppRTCBluetoothManager;
54
+ import com.cloudflare.realtimekit.incallmanager.InCallManagerModule.AudioDevice;
55
55
 
56
56
  public class InCallManagerModule extends ReactContextBaseJavaModule implements LifecycleEventListener, AudioManager.OnAudioFocusChangeListener {
57
57
  private static final String REACT_NATIVE_MODULE_NAME = "InCallManager";
58
58
  private static final String TAG = REACT_NATIVE_MODULE_NAME;
59
- private String mPackageName = "com.reactnativecore.incallmanager";
59
+ private String mPackageName = "com.cloudflare.realtimekit.incallmanager";
60
60
 
61
61
  // --- Screen Manager
62
62
  private PowerManager mPowerManager;
@@ -14,7 +14,7 @@
14
14
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
  */
16
16
 
17
- package com.reactnativecore.incallmanager;
17
+ package com.cloudflare.realtimekit.incallmanager;
18
18
 
19
19
  import android.content.Context;
20
20
  import android.hardware.Sensor;
@@ -29,10 +29,10 @@ import java.lang.Runnable;
29
29
 
30
30
  import com.facebook.react.bridge.UiThreadUtil;
31
31
 
32
- import com.reactnativecore.incallmanager.AppRTCProximitySensor;
32
+ import com.cloudflare.realtimekit.incallmanager.AppRTCProximitySensor;
33
33
 
34
34
  public class InCallProximityManager {
35
- private static final String TAG = "dytesdk:InCallProximity";
35
+ private static final String TAG = "realtimekit:InCallProximity";
36
36
 
37
37
  private WakeLock mProximityLock = null;
38
38
  private Method mPowerManagerRelease;
@@ -14,7 +14,7 @@
14
14
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
  */
16
16
 
17
- package com.reactnativecore.incallmanager;
17
+ package com.cloudflare.realtimekit.incallmanager;
18
18
 
19
19
  import android.content.Context;
20
20
  import android.os.PowerManager;
@@ -22,7 +22,7 @@ import android.os.PowerManager.WakeLock;
22
22
  import android.util.Log;
23
23
 
24
24
  public class InCallWakeLockUtils {
25
- private static final String TAG = "dytesdk:InCallWakeLock";
25
+ private static final String TAG = "realtimekit:InCallWakeLock";
26
26
 
27
27
  private PowerManager mPowerManager;
28
28
 
@@ -7,7 +7,7 @@
7
7
  * in the file PATENTS. All contributing project authors may
8
8
  * be found in the AUTHORS file in the root of the source tree.
9
9
  */
10
- package com.reactnativecore.incallmanager;
10
+ package com.cloudflare.realtimekit.incallmanager;
11
11
  import android.os.Looper;
12
12
  import androidx.annotation.Nullable;
13
13
  public class ThreadUtils {
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="blob_provider_authority">com.cloudflare.realtimekit.blobs</string>
3
+ </resources>
package/app.plugin.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./plugin/build/withDyte');
1
+ module.exports = require('./plugin/build/withRTK');
@@ -16,7 +16,7 @@
16
16
  #endif
17
17
 
18
18
 
19
- @interface DyteRNBackgroundTimer : RCTEventEmitter <RCTBridgeModule>
19
+ @interface RTKRNBackgroundTimer : RCTEventEmitter <RCTBridgeModule>
20
20
 
21
21
  @end
22
22
 
@@ -6,9 +6,9 @@
6
6
  // Copyright (c) ATO Gear. All rights reserved.
7
7
  //
8
8
  @import UIKit;
9
- #import "DyteRNBackgroundTimer.h"
9
+ #import "RTKRNBackgroundTimer.h"
10
10
 
11
- @implementation DyteRNBackgroundTimer {
11
+ @implementation RTKRNBackgroundTimer {
12
12
  UIBackgroundTaskIdentifier bgTask;
13
13
  int delay;
14
14
  }
@@ -77,14 +77,15 @@ RCT_EXPORT_METHOD(setTimeout:(int)timeoutId
77
77
  resolve([NSNumber numberWithBool:YES]);
78
78
  }
79
79
 
80
- /*
81
- RCT_EXPORT_METHOD(clearTimeout:(int)timeoutId
82
- resolver:(RCTPromiseResolveBlock)resolve
83
- rejecter:(RCTPromiseRejectBlock)reject)
80
+ RCT_EXPORT_METHOD(backgroundTimerSetTimeout:(int)timeoutId
81
+ timeout:(double)timeout)
84
82
  {
85
- // Do nothing :)
86
- // timeout will be ignored in javascript anyway :)
87
- }*/
83
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
84
+ if ([self bridge] != nil) {
85
+ [self sendEventWithName:@"backgroundTimer.timeout" body:[NSNumber numberWithInt:timeoutId]];
86
+ }
87
+ });
88
+ }
88
89
 
89
90
  @end
90
91
 
@@ -1,9 +1,9 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTConvert.h>
3
3
  #import <Foundation/Foundation.h>
4
- #import "DyteRNPermissions.h"
4
+ #import "RTKRNPermissions.h"
5
5
 
6
- @interface DyteRNPermissionHandlerNotifications : NSObject
6
+ @interface RTKRNPermissionHandlerNotifications : NSObject
7
7
 
8
8
  + (NSString * _Nonnull)handlerUniqueId;
9
9
 
@@ -1,16 +1,16 @@
1
- #import "DyteRNPermissionHandlerNotifications.h"
1
+ #import "RTKRNPermissionHandlerNotifications.h"
2
2
 
3
3
  @import UserNotifications;
4
4
  @import UIKit;
5
5
 
6
- @interface DyteRNPermissionHandlerNotifications()
6
+ @interface RTKRNPermissionHandlerNotifications()
7
7
 
8
8
  @property (nonatomic, strong) void (^resolve)(RNPermissionStatus status, NSDictionary * _Nonnull settings);
9
9
  @property (nonatomic, strong) void (^reject)(NSError *error);
10
10
 
11
11
  @end
12
12
 
13
- @implementation DyteRNPermissionHandlerNotifications
13
+ @implementation RTKRNPermissionHandlerNotifications
14
14
 
15
15
  + (NSString * _Nonnull)handlerUniqueId {
16
16
  return @"ios.permission.NOTIFICATIONS";
@@ -24,7 +24,7 @@ typedef enum {
24
24
  RNPermissionStatusLimited = 5,
25
25
  } RNPermissionStatus;
26
26
 
27
- @protocol DyteRNPermissionHandler <NSObject>
27
+ @protocol RTKRNPermissionHandler <NSObject>
28
28
 
29
29
  @required
30
30
 
@@ -40,7 +40,7 @@ typedef enum {
40
40
 
41
41
  @end
42
42
 
43
- @interface DyteRNPermissions : NSObject <RCTBridgeModule>
43
+ @interface RTKRNPermissions : NSObject <RCTBridgeModule>
44
44
 
45
45
  + (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;
46
46
 
@@ -1,32 +1,32 @@
1
- #import "DyteRNPermissions.h"
1
+ #import "RTKRNPermissions.h"
2
2
  #import <React/RCTLog.h>
3
3
  #import <React/RCTConvert.h>
4
- #import "DyteRNPermissionHandlerBluetoothPeripheral.h"
5
- #import "DyteRNPermissionHandlerCamera.h"
6
- #import "DyteRNPermissionHandlerMicrophone.h"
7
- #import "DyteRNPermissionHandlerPhotoLibrary.h"
8
- #import "DyteRNPermissionHandlerNotifications.h"
4
+ #import "RTKRNPermissionHandlerBluetoothPeripheral.h"
5
+ #import "RTKRNPermissionHandlerCamera.h"
6
+ #import "RTKRNPermissionHandlerMicrophone.h"
7
+ #import "RTKRNPermissionHandlerPhotoLibrary.h"
8
+ #import "RTKRNPermissionHandlerNotifications.h"
9
9
 
10
10
  static NSString* SETTING_KEY = @"@RNPermissions:Requested";
11
11
 
12
12
  @implementation RCTConvert(RNPermission)
13
13
 
14
14
  RCT_ENUM_CONVERTER(RNPermission, (@{
15
- [DyteRNPermissionHandlerBluetoothPeripheral handlerUniqueId]: @(RNPermissionBluetoothPeripheral),
16
- [DyteRNPermissionHandlerCamera handlerUniqueId]: @(RNPermissionCamera),
17
- [DyteRNPermissionHandlerMicrophone handlerUniqueId]: @(RNPermissionMicrophone),
18
- [DyteRNPermissionHandlerPhotoLibrary handlerUniqueId]: @(RNPermissionPhotoLibrary),
15
+ [RTKRNPermissionHandlerBluetoothPeripheral handlerUniqueId]: @(RNPermissionBluetoothPeripheral),
16
+ [RTKRNPermissionHandlerCamera handlerUniqueId]: @(RNPermissionCamera),
17
+ [RTKRNPermissionHandlerMicrophone handlerUniqueId]: @(RNPermissionMicrophone),
18
+ [RTKRNPermissionHandlerPhotoLibrary handlerUniqueId]: @(RNPermissionPhotoLibrary),
19
19
  }), RNPermissionUnknown, integerValue);
20
20
 
21
21
  @end
22
22
 
23
- @interface DyteRNPermissions()
23
+ @interface RTKRNPermissions()
24
24
 
25
- @property (nonatomic, strong) NSMutableDictionary<NSString *, id<DyteRNPermissionHandler>> *_Nonnull handlers;
25
+ @property (nonatomic, strong) NSMutableDictionary<NSString *, id<RTKRNPermissionHandler>> *_Nonnull handlers;
26
26
 
27
27
  @end
28
28
 
29
- @implementation DyteRNPermissions
29
+ @implementation RTKRNPermissions
30
30
 
31
31
  RCT_EXPORT_MODULE();
32
32
 
@@ -42,10 +42,10 @@ RCT_EXPORT_MODULE();
42
42
  NSMutableArray<NSString *> *available = [NSMutableArray new];
43
43
 
44
44
 
45
- [available addObject:[DyteRNPermissionHandlerBluetoothPeripheral handlerUniqueId]];
46
- [available addObject:[DyteRNPermissionHandlerCamera handlerUniqueId]];
47
- [available addObject:[DyteRNPermissionHandlerMicrophone handlerUniqueId]];
48
- [available addObject:[DyteRNPermissionHandlerPhotoLibrary handlerUniqueId]];
45
+ [available addObject:[RTKRNPermissionHandlerBluetoothPeripheral handlerUniqueId]];
46
+ [available addObject:[RTKRNPermissionHandlerCamera handlerUniqueId]];
47
+ [available addObject:[RTKRNPermissionHandlerMicrophone handlerUniqueId]];
48
+ [available addObject:[RTKRNPermissionHandlerPhotoLibrary handlerUniqueId]];
49
49
 
50
50
  #if RCT_DEV
51
51
  if ([available count] == 0) {
@@ -74,23 +74,23 @@ RCT_EXPORT_MODULE();
74
74
  #endif
75
75
  }
76
76
 
77
- - (id<DyteRNPermissionHandler> _Nullable)handlerForPermission:(RNPermission)permission {
78
- id<DyteRNPermissionHandler> handler = nil;
77
+ - (id<RTKRNPermissionHandler> _Nullable)handlerForPermission:(RNPermission)permission {
78
+ id<RTKRNPermissionHandler> handler = nil;
79
79
 
80
80
  switch (permission) {
81
81
 
82
82
  case RNPermissionBluetoothPeripheral:
83
- handler = [DyteRNPermissionHandlerBluetoothPeripheral new];
83
+ handler = [RTKRNPermissionHandlerBluetoothPeripheral new];
84
84
  break;
85
85
 
86
86
  case RNPermissionCamera:
87
- handler = [DyteRNPermissionHandlerCamera new];
87
+ handler = [RTKRNPermissionHandlerCamera new];
88
88
  break;
89
89
  case RNPermissionMicrophone:
90
- handler = [DyteRNPermissionHandlerMicrophone new];
90
+ handler = [RTKRNPermissionHandlerMicrophone new];
91
91
  break;
92
92
  case RNPermissionPhotoLibrary:
93
- handler = [DyteRNPermissionHandlerPhotoLibrary new];
93
+ handler = [RTKRNPermissionHandlerPhotoLibrary new];
94
94
  break;
95
95
  case RNPermissionUnknown:
96
96
  break; // RCTConvert prevents this case
@@ -116,7 +116,7 @@ RCT_EXPORT_MODULE();
116
116
  }
117
117
  }
118
118
 
119
- - (NSString *)lockHandler:(id<DyteRNPermissionHandler>)handler {
119
+ - (NSString *)lockHandler:(id<RTKRNPermissionHandler>)handler {
120
120
  if (_handlers == nil) {
121
121
  _handlers = [NSMutableDictionary new];
122
122
  }
@@ -172,7 +172,7 @@ RCT_REMAP_METHOD(check,
172
172
  checkWithPermission:(RNPermission)permission
173
173
  resolver:(RCTPromiseResolveBlock)resolve
174
174
  rejecter:(RCTPromiseRejectBlock)reject) {
175
- id<DyteRNPermissionHandler> handler = [self handlerForPermission:permission];
175
+ id<RTKRNPermissionHandler> handler = [self handlerForPermission:permission];
176
176
  NSString *lockId = [self lockHandler:handler];
177
177
 
178
178
  [handler checkWithResolver:^(RNPermissionStatus status) {
@@ -188,7 +188,7 @@ RCT_REMAP_METHOD(request,
188
188
  requestWithPermission:(RNPermission)permission
189
189
  resolver:(RCTPromiseResolveBlock)resolve
190
190
  rejecter:(RCTPromiseRejectBlock)reject) {
191
- id<DyteRNPermissionHandler> handler = [self handlerForPermission:permission];
191
+ id<RTKRNPermissionHandler> handler = [self handlerForPermission:permission];
192
192
  NSString *lockId = [self lockHandler:handler]; [handler requestWithResolver:^(RNPermissionStatus status) {
193
193
  resolve([self stringForStatus:status]);
194
194
  [self unlockHandler:lockId];
@@ -201,9 +201,9 @@ RCT_REMAP_METHOD(request,
201
201
  RCT_REMAP_METHOD(checkNotifications,
202
202
  checkNotificationsWithResolver:(RCTPromiseResolveBlock)resolve
203
203
  rejecter:(RCTPromiseRejectBlock)reject) {
204
- #if __has_include("DyteRNPermissionHandlerNotifications.h")
205
- DyteRNPermissionHandlerNotifications *handler = [DyteRNPermissionHandlerNotifications new];
206
- NSString *lockId = [self lockHandler:(id<DyteRNPermissionHandler>)handler];
204
+ #if __has_include("RTKRNPermissionHandlerNotifications.h")
205
+ RTKRNPermissionHandlerNotifications *handler = [RTKRNPermissionHandlerNotifications new];
206
+ NSString *lockId = [self lockHandler:(id<RTKRNPermissionHandler>)handler];
207
207
 
208
208
  [handler checkWithResolver:^(RNPermissionStatus status, NSDictionary * _Nonnull settings) {
209
209
  resolve(@{ @"status": [self stringForStatus:status], @"settings": settings });
@@ -221,9 +221,9 @@ RCT_REMAP_METHOD(requestNotifications,
221
221
  requestNotificationsWithOptions:(NSArray<NSString *> * _Nonnull)options
222
222
  resolver:(RCTPromiseResolveBlock)resolve
223
223
  rejecter:(RCTPromiseRejectBlock)reject) {
224
- #if __has_include("DyteRNPermissionHandlerNotifications.h")
225
- DyteRNPermissionHandlerNotifications *handler = [DyteRNPermissionHandlerNotifications new];
226
- NSString *lockId = [self lockHandler:(id<DyteRNPermissionHandler>)handler];
224
+ #if __has_include("RTKRNPermissionHandlerNotifications.h")
225
+ RTKRNPermissionHandlerNotifications *handler = [RTKRNPermissionHandlerNotifications new];
226
+ NSString *lockId = [self lockHandler:(id<RTKRNPermissionHandler>)handler];
227
227
 
228
228
  [handler requestWithResolver:^(RNPermissionStatus status, NSDictionary * _Nonnull settings) {
229
229
  resolve(@{ @"status": [self stringForStatus:status], @"settings": settings });
@@ -241,7 +241,7 @@ RCT_REMAP_METHOD(openLimitedPhotoLibraryPicker,
241
241
  openLimitedPhotoLibraryPickerWithResolver:(RCTPromiseResolveBlock)resolve
242
242
  rejecter:(RCTPromiseRejectBlock)reject) {
243
243
 
244
- DyteRNPermissionHandlerPhotoLibrary *handler = [DyteRNPermissionHandlerPhotoLibrary new];
244
+ RTKRNPermissionHandlerPhotoLibrary *handler = [RTKRNPermissionHandlerPhotoLibrary new];
245
245
  [handler openLimitedPhotoLibraryPickerWithResolver:resolve rejecter:reject];
246
246
  }
247
247