Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
android:excludeFromRecents="true"
android:taskAffinity="chat.rocket.reactnative.voip" />

<receiver
android:name="chat.rocket.reactnative.voip.VoipNotification$DeclineReceiver"
android:enabled="true"
android:exported="false" />

<service
android:name="chat.rocket.reactnative.voip.VoipForegroundService"
android:exported="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import chat.rocket.reactnative.storage.SecureStoragePackage;
import chat.rocket.reactnative.notification.VideoConfTurboPackage
import chat.rocket.reactnative.notification.PushNotificationTurboPackage
import chat.rocket.reactnative.VoipTurboPackage
import chat.rocket.reactnative.utils.CallIdUUIDTurboPackage

/**
* Main Application class.
Expand All @@ -46,7 +45,6 @@ open class MainApplication : Application(), ReactApplication {
add(VideoConfTurboPackage())
add(PushNotificationTurboPackage())
add(VoipTurboPackage())
add(CallIdUUIDTurboPackage())
add(SecureStoragePackage())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Ejson {
private static final String TAG = "RocketChat.Ejson";
private static final String TOKEN_KEY = "reactnativemeteor_usertoken-";

String host;
public String host;
String rid;
String type;
Sender sender;
Expand Down Expand Up @@ -264,4 +264,4 @@ static class Content {
String kid;
String iv;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class NotificationIntentHandler {
Log.d(TAG, "Handling VoIP intent - voipPayload: $voipPayload")

VoipNotification.cancelById(context, voipPayload.notificationId)
VoipNotification.cancelTimeout(voipPayload.callId)
VoipModule.storeInitialEvents(voipPayload)

if (context is Activity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,29 @@ class RCFirebaseMessagingService : FirebaseMessagingService() {
}

override fun onMessageReceived(remoteMessage: RemoteMessage) {
Log.d(TAG, "FCM message received from: ${remoteMessage.from}")
// TODO: remove data
Log.d(TAG, "FCM message received from: ${remoteMessage.from} data: ${remoteMessage.data}")

val data = remoteMessage.data
if (data.isEmpty()) {
Log.w(TAG, "FCM message has no data payload, ignoring")
return
}

// Convert FCM data to Bundle for processing
val bundle = Bundle().apply {
data.forEach { (key, value) ->
putString(key, value)
}
}

val voipPayload = VoipPayload.fromMap(data)
if (voipPayload != null) {
Log.d(TAG, "Detected VoIP incoming call payload, routing to VoipNotification handler")
VoipNotification(this).showIncomingCall(voipPayload)
Log.d(TAG, "Detected VoIP payload of type ${voipPayload.type}, routing to VoipNotification handler")
VoipNotification(this).onMessageReceived(voipPayload)
return
}

// Process regular notifications via CustomPushNotification
try {
val bundle = Bundle().apply {
data.forEach { (key, value) ->
putString(key, value)
}
}
val notification = CustomPushNotification(this, bundle)
notification.onReceived()
} catch (e: Exception) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading