Skip to content
This repository was archived by the owner on May 26, 2019. It is now read-only.
This repository was archived by the owner on May 26, 2019. It is now read-only.

help setting up event listener? #44

Open

Description

I think I have react-native-callkit set up correctly, because I can get checkIfBusy to report true if I am in a call, and false otherwise. I am somewhat new to react-native so please forgive me if this is something basic!

However, I'm having trouble getting the event listeners to work.

My current setup is this:

in the component constructor:
RNCallKit.addEventListener('didReceiveStartCallAction', this.onRNCallKitDidReceiveStartCallAction);

as the first component method after the constructor and the state declaration:

onRNCallKitDidReceiveStartCallAction(data) {
   
 console.log('--Start call action--');
    console.log(data);
    console.log(uuid);
    const myUuid = uuid.v4();
    RNCallKit.startCall(myUuid, data.handle);
  }

I open the app on my Iphone (5s with iOS 11.4), with XCode and the debugger running, and make a call from my Recents, but the console doesn't display '--Start call action--', which I interpret to mean that this event is not being processed.

I'm not seeing any error messages or anything. Thank you for any help!

Activity

  1. davidcantonnoteges commented on Jul 5, 2018

    @davidcantonnoteges

    +1

  2. davidcantonnoteges commented on Jul 17, 2018

    @davidcantonnoteges

    Listeners not working for me, none fired when receive calls, or i make calls..

  3. aarkalyk commented on Jul 17, 2018

    @aarkalyk
    Contributor

    Hey guys!

    Are you sure you've implemented this delegate method?

    - (BOOL)application:(UIApplication *)application
    continueUserActivity:(NSUserActivity *)userActivity
      restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
    {
      return [RNCallKit application:application
               continueUserActivity:userActivity
                 restorationHandler:restorationHandler];
    }
  4. aarkalyk commented on Jul 17, 2018

    @aarkalyk
    Contributor

    I think these lines should be removed. No need to initialize RNCallKit.

    ///*
      //Initialise RNCallKit
      RNCallKit *rncallkit = [[RNCallKit alloc] init];
    
      //Initialise React Bridge with RNCallKit
      RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
                                          moduleProvider:^{ return @[rncallkit]; }
                                          launchOptions:launchOptions];
    
      //Initialise React Root View with React Bridge you've just created
      RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                     moduleName:@"catchup"
                                                     initialProperties:nil];
      //*/
  5. davidcantonnoteges commented on Jul 17, 2018

    @davidcantonnoteges

    I have removed these lines and no working in my project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions