I am implementing calls (one-on-one and group) on ...
# ask-ai
l
I am implementing calls (one-on-one and group) on a React Native app. I've been able to achieve some milestones, but some core challenges remain. One of the challenges is receiving call notification (full UI display & push notification) when the app is in the background or terminated state. I've only been able to render a full UI call notification display when the user is active on the app. Secondly, for a one-on-one call, when one party ends the call, it does not end immediately on the other party's end; sometimes it doesn't end at all until the app is terminated. How do I solve these issues?
t
Thanks for reaching out, A.. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I understand the challenges you're facing, and I’m here to help you through them step by step: 1. Full UI Call Notification in Background or Terminated State: - For Android, a great approach is to use a foreground service to keep your app active and show a persistent notification. You might find the @supersami/rn-foreground-service library really helpful for this. - On iOS, you can use CallKit through react-native-callkeep to display the native call UI and make sure to enable the 'voip' background mode in Xcode for smooth functionality. 2. Push Notifications for Terminated State: Since LiveKit doesn’t send push notifications directly, you’ll want to set up an external push notification system like Firebase Cloud Messaging (FCM) for Android or Apple Push Notification Service (APNs) for iOS. For iOS especially, using VoIP push notifications via PushKit is a great way to wake the app and present the CallKit UI seamlessly. 3. Call Termination Issue: To make sure calls end properly, it’s important that the signaling between both parties is working correctly. When one person ends the call, the signaling server should notify the other to close the session. It might be helpful to review your signaling logic to ensure it’s handling these termination events as expected. If you’d like, I can provide more detailed guidance on setting up push notifications, integrating CallKit, or troubleshooting your signaling logic. Just let me know how I can assist you further! Sources: docs/index.html
l
the app is Expo managed, provide solutions that works seamlessly with an expo-managed project
t
Thanks for sharing that your app is Expo-managed! I understand that sometimes native modules like CallKit or foreground services might not work right away in this setup. To help you better, could you please let me know: • Would you be open to using Expo's EAS Build to include some custom native code? • Or are you looking for solutions that work without needing to eject from Expo? Knowing this will really help me suggest the best options tailored just for your project. I'm here to support you every step of the way!
l
Yes, i have done a prebuild, which has created the native android and ios codes
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
l
yes, i am open to using Expo’s EAS Build to include some custom native code