ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
125 stars 111 forks source link

Receive video call like whatsapp when app is in background #96

Closed parthgandhi85 closed 4 years ago

parthgandhi85 commented 4 years ago

I have read all the documents provided by connectycube but I am not able to implement incoming call notification like whatsapp when app is in background or killed state. how do i show custom notification with accept and reject button while incoming call when app is in background? I have integrated react-native-voip-push-notification and react-native-callkeep libs but it did not work.

banshiAnton commented 4 years ago

Hi @parthgandhi85 in this case you can create push event (https://developers.connectycube.com/js/push-notifications?id=send-push-notifications) When device receive push on android you can start activity or show notification with actions (or fullscreen intent) https://github.com/zo0r/react-native-push-notification and on android you can use https://reactnative.dev/docs/headless-js-android For ios is better to use voip push notifications + callkeep https://developers.connectycube.com/reactnative/push-notifications?id=callkit-and-voip-push-notifications

For voip push you need create another subscription with notification_channels = 'apns_voip' "I have integrated react-native-voip-push-notification and react-native-callkeep libs but it did not work." maybe this is problems with that libs Please check that you send exactly voip push (ios_voip: 1) (in ios project you can add logs or breakpoint to didReceiveIncomingPushWithPayload)

banshiAnton commented 4 years ago

If there is no activity, I will close this issue

CMLCNL commented 3 years ago

Hello, I have read all your documents. However, none of the reporting methods you suggest is healthy. What else can we do to send calls in the background. Your suggestions will not. These are not real solutions.

DaveLomber commented 3 years ago

@CMLCNL please check https://developers.connectycube.com/js/videocalling?id=receive-a-call-in-background

CMLCNL commented 3 years ago

@DaveLomber Why my payload is always nil on objective-c? I cant get voip.

  [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];

  NSString *uuid = payload.dictionaryPayload[@"uuid"];
  NSString *callerName = payload.dictionaryPayload[@"callerName"];
  NSString *handle = payload.dictionaryPayload[@"handle"];
DaveLomber commented 3 years ago

@CMLCNL please show how you send a VoiP push