voice-react-native-sdk 1.6.2-fork.23-hack → 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,19 +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
- // Do not set full screen intent for CallStyle notifications on Android 14+.
178
- // CallStyle.forIncomingCall() already provides the system call UI with answer/reject buttons
179
- // that work properly even when the phone is locked. Setting a full screen intent interferes
180
- // with the system call UI, preventing the answer/reject buttons from appearing.
181
- return builder.build();
176
+ incomingCaller, piRejectIntent, piAcceptIntent))
177
+ .build();
182
178
  }
183
179
 
184
180
  public static Notification createCallAnsweredNotificationWithLowImportance(@NonNull Context context,
@@ -206,18 +202,16 @@ class NotificationUtility {
206
202
  callRecord.getUuid());
207
203
  PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
208
204
 
209
- NotificationCompat.Builder builder = constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
205
+ return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
210
206
  .setSmallIcon(notificationResource.getSmallIconId())
211
207
  .setCategory(Notification.CATEGORY_CALL)
212
208
  .setAutoCancel(false)
213
209
  .setContentIntent(piForegroundIntent)
210
+ .setFullScreenIntent(piForegroundIntent, true)
214
211
  .setOngoing(true)
215
212
  .addPerson(activeCaller)
216
- .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent));
217
- // Do not set full screen intent for CallStyle notifications on Android 14+.
218
- // CallStyle.forOngoingCall() provides the system call UI that works properly even when the phone is locked.
219
- // Setting a full screen intent interferes with the system call UI.
220
- return builder.build();
213
+ .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
214
+ .build();
221
215
  }
222
216
 
223
217
  public static Notification createOutgoingCallNotificationWithLowImportance(@NonNull Context context,
@@ -245,18 +239,16 @@ class NotificationUtility {
245
239
  callRecord.getUuid());
246
240
  PendingIntent piEndCallIntent = constructPendingIntentForService(context, endCallIntent);
247
241
 
248
- NotificationCompat.Builder builder = constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
242
+ return constructNotificationBuilder(context, Constants.VOICE_CHANNEL_LOW_IMPORTANCE)
249
243
  .setSmallIcon(notificationResource.getSmallIconId())
250
244
  .setCategory(Notification.CATEGORY_CALL)
251
245
  .setAutoCancel(false)
252
246
  .setContentIntent(piForegroundIntent)
247
+ .setFullScreenIntent(piForegroundIntent, true)
253
248
  .setOngoing(true)
254
249
  .addPerson(activeCaller)
255
- .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent));
256
- // Do not set full screen intent for CallStyle notifications on Android 14+.
257
- // CallStyle.forOngoingCall() provides the system call UI that works properly even when the phone is locked.
258
- // Setting a full screen intent interferes with the system call UI.
259
- return builder.build();
250
+ .setStyle(NotificationCompat.CallStyle.forOngoingCall(activeCaller, piEndCallIntent))
251
+ .build();
260
252
  }
261
253
 
262
254
  public static void createNotificationChannels(@NonNull Context context) {
@@ -280,11 +272,6 @@ class NotificationUtility {
280
272
  notificationManager.deleteNotificationChannelGroup(Constants.VOICE_CHANNEL_GROUP);
281
273
  }
282
274
 
283
- public static boolean isFullscreenIntentEnabled(Context context) {
284
- return isFullScreenNotificationEnabled(context) &&
285
- NotificationManagerCompat.from(context).canUseFullScreenIntent();
286
- }
287
-
288
275
  private static NotificationChannelCompat createNotificationChannel(@NonNull Context context,
289
276
  @NonNull final String voiceChannelId) {
290
277
  final int notificationImportance = getChannelImportance(voiceChannelId);
@@ -361,4 +348,4 @@ class NotificationUtility {
361
348
  .appendPath(String.valueOf(id))
362
349
  ).build();
363
350
  }
364
- }
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.23-hack",
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",