voice-react-native-sdk 1.6.2-fork.22 → 1.6.2-fork.24-hack

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.
@@ -3,7 +3,7 @@ buildscript {
3
3
  'java' : JavaVersion.VERSION_11,
4
4
  'androidGradlePlugin': '7.4.2',
5
5
  'googleServices' : '4.3.10',
6
- 'voiceAndroid' : '6.7.1',
6
+ 'voiceAndroid' : '6.9.0',
7
7
  'androidxCore' : '1.12.0',
8
8
  'androidxLifecycle' : '2.2.0',
9
9
  'audioSwitch' : '1.2.2',
@@ -4,7 +4,6 @@
4
4
  <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
5
5
  <uses-permission android:name="android.permission.INTERNET" />
6
6
  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
7
- <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
8
7
  <uses-permission android:name="android.permission.WAKE_LOCK" />
9
8
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
10
9
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
@@ -16,7 +15,7 @@
16
15
  <service
17
16
  android:name=".VoiceFirebaseMessagingService"
18
17
  android:stopWithTask="false"
19
- android:exported="true"
18
+ android:exported="false"
20
19
  android:enabled="@bool/twiliovoicereactnative_firebasemessagingservice_enabled">
21
20
  <intent-filter>
22
21
  <action android:name="com.google.firebase.MESSAGING_EVENT" />
@@ -57,7 +57,11 @@ class CallListenerProxy implements Call.Listener {
57
57
  getAudioSwitchManager().getAudioSwitch().deactivate();
58
58
 
59
59
  // find call record & remove
60
- CallRecord callRecord = Objects.requireNonNull(getCallRecordDatabase().remove(new CallRecord(uuid)));
60
+ //CallRecord callRecord = Objects.requireNonNull(getCallRecordDatabase().remove(new CallRecord(uuid)));
61
+ CallRecord callRecord = getCallRecordDatabase().remove(new CallRecord(uuid));
62
+ if (callRecord == null) {
63
+ return;
64
+ }
61
65
 
62
66
  // take down notification
63
67
  getVoiceServiceApi().cancelActiveCallNotification(callRecord);
@@ -24,7 +24,6 @@ import androidx.core.app.Person;
24
24
 
25
25
  import com.twilio.voice.CallInvite;
26
26
 
27
- import static com.twiliovoicereactnative.ConfigurationProperties.isFullScreenNotificationEnabled;
28
27
  import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_DEFAULT_IMPORTANCE;
29
28
  import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_HIGH_IMPORTANCE;
30
29
  import static com.twiliovoicereactnative.Constants.VOICE_CHANNEL_LOW_IMPORTANCE;
@@ -166,18 +165,16 @@ class NotificationUtility {
166
165
  callRecord.getUuid());
167
166
  PendingIntent piAcceptIntent = constructPendingIntentForActivity(context, acceptIntent);
168
167
 
169
- NotificationCompat.Builder builder = constructNotificationBuilder(context, channelImportance)
168
+ return constructNotificationBuilder(context, channelImportance)
170
169
  .setSmallIcon(notificationResource.getSmallIconId())
171
170
  .setCategory(Notification.CATEGORY_CALL)
172
171
  .setAutoCancel(true)
173
172
  .setContentIntent(piForegroundIntent)
173
+ .setFullScreenIntent(piForegroundIntent, true)
174
174
  .addPerson(incomingCaller)
175
175
  .setStyle(NotificationCompat.CallStyle.forIncomingCall(
176
- incomingCaller, piRejectIntent, piAcceptIntent));
177
- if (isFullscreenIntentEnabled(context)) {
178
- builder.setFullScreenIntent(piForegroundIntent, true);
179
- }
180
- return builder.build();
176
+ incomingCaller, piRejectIntent, piAcceptIntent))
177
+ .build();
181
178
  }
182
179
 
183
180
  public static Notification createCallAnsweredNotificationWithLowImportance(@NonNull Context context,
@@ -205,18 +202,16 @@ class NotificationUtility {
205
202
  callRecord.getUuid());
206
203
  PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
207
204
 
208
- NotificationCompat.Builder builder = constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
205
+ return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
209
206
  .setSmallIcon(notificationResource.getSmallIconId())
210
207
  .setCategory(Notification.CATEGORY_CALL)
211
208
  .setAutoCancel(false)
212
209
  .setContentIntent(piForegroundIntent)
210
+ .setFullScreenIntent(piForegroundIntent, true)
213
211
  .setOngoing(true)
214
212
  .addPerson(activeCaller)
215
- .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent));
216
- if (isFullscreenIntentEnabled(context)) {
217
- builder.setFullScreenIntent(piForegroundIntent, true);
218
- }
219
- return builder.build();
213
+ .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
214
+ .build();
220
215
  }
221
216
 
222
217
  public static Notification createOutgoingCallNotificationWithLowImportance(@NonNull Context context,
@@ -244,18 +239,16 @@ class NotificationUtility {
244
239
  callRecord.getUuid());
245
240
  PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
246
241
 
247
- NotificationCompat.Builder builder = constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
242
+ return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
248
243
  .setSmallIcon(notificationResource.getSmallIconId())
249
244
  .setCategory(Notification.CATEGORY_CALL)
250
245
  .setAutoCancel(false)
251
246
  .setContentIntent(piForegroundIntent)
247
+ .setFullScreenIntent(piForegroundIntent, true)
252
248
  .setOngoing(true)
253
249
  .addPerson(activeCaller)
254
- .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent));
255
- if (isFullscreenIntentEnabled(context)) {
256
- builder.setFullScreenIntent(piForegroundIntent, true);
257
- }
258
- return builder.build();
250
+ .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
251
+ .build();
259
252
  }
260
253
 
261
254
  public static void createNotificationChannels(@NonNull Context context) {
@@ -279,11 +272,6 @@ class NotificationUtility {
279
272
  notificationManager.deleteNotificationChannelGroup(Constants.VOICE_CHANNEL_GROUP);
280
273
  }
281
274
 
282
- public static boolean isFullscreenIntentEnabled(Context context) {
283
- return isFullScreenNotificationEnabled(context) &&
284
- NotificationManagerCompat.from(context).canUseFullScreenIntent();
285
- }
286
-
287
275
  private static NotificationChannelCompat createNotificationChannel(@NonNull Context context,
288
276
  @NonNull final String voiceChannelId) {
289
277
  final int notificationImportance = getChannelImportance(voiceChannelId);
@@ -360,4 +348,4 @@ class NotificationUtility {
360
348
  .appendPath(String.valueOf(id))
361
349
  ).build();
362
350
  }
363
- }
351
+ }
@@ -646,6 +646,8 @@ public class TwilioVoiceReactNativeModule extends ReactContextBaseJavaModule {
646
646
 
647
647
  @ReactMethod
648
648
  public void system_requestFullScreenNotificationPermission(Promise promise) {
649
+ promise.resolve(null);
650
+ /*
649
651
  final boolean shouldStartActivity =
650
652
  Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU &&
651
653
  isFullScreenNotificationEnabled(reactContext);
@@ -663,6 +665,7 @@ public class TwilioVoiceReactNativeModule extends ReactContextBaseJavaModule {
663
665
  }
664
666
 
665
667
  promise.resolve(null);
668
+ */
666
669
  }
667
670
 
668
671
  @Override
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <resources>
3
- <bool name="twiliovoicereactnative_firebasemessagingservice_enabled">true</bool>
4
- <bool name="twiliovoicereactnative_fullscreennotification_enabled">true</bool>
3
+ <bool name="twiliovoicereactnative_firebasemessagingservice_enabled">false</bool>
4
+ <bool name="twiliovoicereactnative_fullscreennotification_enabled">false</bool>
5
5
  </resources>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voice-react-native-sdk",
3
- "version": "1.6.2-fork.22",
3
+ "version": "1.6.2-fork.24-hack",
4
4
  "description": "Twilio Voice React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",