question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connectycube connects to chat server too late. (RN Voip and Call-Keep)

See original GitHub issue

Hello, I use voip push to wake up an application. RN call-keep works right after waking the application with Voip. However, these are happening on the native side. On the Rn side, call-keep works before I connect to the chat. As soon as the user answers the call, only the open application comes in front of him. How can we synchronize both.

- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {
  // Process the received push
  [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
  
  NSObject* aps = payload.dictionaryPayload[@"aps"];
  
  NSString* alert = [aps valueForKey:@"alert"];
  
  NSLog(@"%@", alert);
  
  NSData *webData = [alert dataUsingEncoding:NSUTF8StringEncoding];
  NSError *error;
  NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:webData options:NSJSONReadingMutableContainers error:&error];

  NSLog(@"%@", jsonDic);
  
  NSString *uuid = [jsonDic valueForKey:@"uuid"];
  NSString *callerName = [jsonDic valueForKey:@"callerName"];
  NSString *handle = [jsonDic valueForKey:@"handle"];

  NSLog(@"%@ %@ %@", handle,callerName,uuid);
  
  BOOL hasVideo = NO;
  
  if ([[jsonDic valueForKey:@"hasVideo"] isEqualToString:(@"1")]) {
    hasVideo = YES;
  } else {
    hasVideo = NO;
  }
  
  if([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive)
  {
      [RNCallKeep reportNewIncomingCall: uuid
                               handle: handle
                           handleType: @"generic"
                             hasVideo: hasVideo
                  localizedCallerName: callerName
                      supportsHolding: NO
                         supportsDTMF: YES
                     supportsGrouping: NO
                   supportsUngrouping: NO
                          fromPushKit: YES
                              payload: nil
                withCompletionHandler: completion];
  }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
DaveLombercommented, Jan 25, 2021

@meosieudang @CMLCNL I think the best way will be to implement it on our side an integrate in P2P code sample. Will try to dod it this week and share

0reactions
ccvladcommented, Jan 25, 2022

Closed due to inactivity. Please create a new issue if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple guide for React Native WebRTC Video Calling (via ...
ConnectyCube Chat API is used as a signaling transport for Video Calling API, so in order to start using Video Calling API you...
Read more >
Simple guide for React Native Chat (via ConnectyCube SDK + ...
ConnectyCube Chat (messaging) API is built on top of Real-time(XMPP) protocol. ... The SDK reconnects automatically when connection to Chat server is lost....
Read more >
Push notifications - ConnectyCube
Push Notifications. Push Notifications provide a way to deliver some information to user while he is not using your app actively.
Read more >
video calling | ConnectyCube
ConnectyCube helps you implement real-time chat, video chat, push notifications and user authorization to any app with ease - no server side implementation ......
Read more >
Push notifications - ConnectyCube
Push Notifications provide a way to deliver some information to users while they are not using your app actively. The following use cases...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found