Git Product home page Git Product logo

react-native-callkit's Introduction

DEPRECATED

This is no longer supported, please use react-native-callkeep instead.

--

React Native CallKit - iOS >= 10.0 only

npm version npm downloads

React Native CallKit utilises a brand new iOS 10 framework CallKit to make the life easier for VoIP developers using React Native.

For more information about CallKit, please see Official CallKit Framework Document or Introduction to CallKit by Xamarin

Note: Since CallKit is quite new, this module will be updated frequently so be careful with the version you are using.

Version

Use version >= 1.1.0 if you're using react native >= 0.40

Installation (without CocoaPods)

NPM module

npm install --save react-native-callkit

Link Library

rnpm link react-native-callkit

Installation (with CocoaPods)

NPM module

npm install --save react-native-callkit

CocaPods

cd ios
pod install

Installation common steps

Info.plist

Add voip under UIBackgroundModes

Note that it must be done via editing Info.plist as in Xcode 9 there is no voip option in Capabilities.

<key>UIBackgroundModes</key>
<array>
  <string>voip</string>
</array>

Add Frameworks

In Xcode -> Build Phases -> Link Binary With Libraries, add CallKit.framework and Intents.framework with Optional status

AppDelegate.m

- Import Library

#import "RNCallKit.h"

- Change the way you initialise React Root View (required if <= 1.2.1)

Initialise RNCallKit first, since we need our custom observer of NSNotificationCenter to be started as soon as the app is initialising

// This is how you normally initialise React Root View, delete it
-RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
-                                                    moduleName:@"MyApp"
-                                             initialProperties:nil
-                                                 launchOptions:launchOptions];

// 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:@"MyApp"
+                                          initialProperties:nil];

- Handling User Activity

This delegate will be called when the user tries to start a call from native Phone App

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
  restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
{
  return [RNCallKit application:application
           continueUserActivity:userActivity
             restorationHandler:restorationHandler];
}

API

setup

  • options: object
    • appName: string (required)
      • It will be displayed on system UI when incoming calls received
    • imageName: string (optional)
      • If provided, it will be displayed on system UI during the call
    • ringtoneSound: string (optional)
      • If provided, it will be played when incoming calls received; the system will use the default ringtone if this is not provided

Initialise RNCallKit with options

displayIncomingCall

  • uuid: string
  • handle: string
  • handleType: string (optional)
    • generic
    • number (default)
    • email
  • hasVideo: boolean (optional)
    • false (default)
  • localizedCallerName: string (optional)

Call when you receive incoming calls to display system UI

startCall

  • uuid: string
  • handle: string
  • handleType: string (optional)
    • generic
    • number (default)
    • email
  • contactIdentifier: string (optional)
    • The identifier is displayed in the native call UI, and is typically the name of the call recipient.

Call when you make an outgoing call

endCall

  • uuid: string

Call when you finish an incoming/outgoing call

setMutedCall

  • uuid: string
  • muted: boolean

Switch the mic on/off

checkIfBusy

Checks if there are any active calls on the device and returns a promise with a boolean value (true if there're active calls, false otherwise).

checkSpeaker

Checks if the device speaker is on and returns a promise with a boolean value (true if speaker is on, false otherwise).

Events

- didReceiveStartCallAction

data:

{
  handle: '886900000000' // The number/name got from Recents in built-in Phone app
}

User start call action from Recents in built-in Phone app

Try to start your call action from here (e.g. get credentials of the user by data.handle and/or send INVITE to your SIP server)

After all works are done, remember to call RNCallKit.startCall(uuid, calleeNumber)

- answerCall

User answer the incoming call

Do your normal Answering actions here

data:

{
  callUUID: 'f0ee907b-6dbd-45a8-858a-903decb198f8' // The UUID of the call that is to be answered
}

- endCall

User finish the call

Do your normal Hang Up actions here

data:

{
  callUUID: 'f0ee907b-6dbd-45a8-858a-903decb198f8' // The UUID of the call that is to be hung
}

- didActivateAudioSession

The AudioSession has been activated by RNCallKit, you might want to do following things when receiving this event:

  • Start playing ringback if it is an outgoing call

- didDisplayIncomingCall

Callback for RNCallKit.displayIncomingCall

error: string (optional)

- didPerformSetMutedCallAction

A call was muted by the system or the user:

muted: boolean

Usage

import React from 'react';
import RNCallKit from 'react-native-callkit';

import uuid from 'uuid';

class RNCallKitExample extends React.Component {
  constructor(props) {

    // Initialise RNCallKit
    let options = {
        appName: 'RNCallKitExample',
        imageName: 'my_image_name_in_bundle',
        ringtoneSound: 'my_ringtone_sound_filename_in_bundle',
    };
    try {
        RNCallKit.setup(options);
    } catch (err) {
        console.log('error:', err.message);
    }

    // Add RNCallKit Events
    RNCallKit.addEventListener('didReceiveStartCallAction', this.onRNCallKitDidReceiveStartCallAction);
    RNCallKit.addEventListener('answerCall', this.onRNCallKitPerformAnswerCallAction);
    RNCallKit.addEventListener('endCall', this.onRNCallKitPerformEndCallAction);
    RNCallKit.addEventListener('didActivateAudioSession', this.onRNCallKitDidActivateAudioSession);
    RNCallKit.addEventListener('didDisplayIncomingCall', this.onRNCallKitDidDisplayIncomingCall);
    RNCallKit.addEventListener('didPerformSetMutedCallAction', this.onRNCallKitDidPerformSetMutedCallAction);
  }

  onRNCallKitDidReceiveStartCallAction(data) {
    /*
     * Your normal start call action
     *
     * ...
     *
     */

    let _uuid = uuid.v4();
    RNCallKit.startCall(_uuid, data.handle);
  }

  onRNCallKitPerformAnswerCallAction(data) {
    /* You will get this event when the user answer the incoming call
     *
     * Try to do your normal Answering actions here
     *
     * e.g. this.handleAnswerCall(data.callUUID);
     */
  }

  onRNCallKitPerformEndCallAction(data) {
    /* You will get this event when the user finish the incoming/outgoing call
     *
     * Try to do your normal Hang Up actions here
     *
     * e.g. this.handleHangUpCall(data.callUUID);
     */
  }

  onRNCallKitDidActivateAudioSession(data) {
    /* You will get this event when the the AudioSession has been activated by **RNCallKit**,
     * you might want to do following things when receiving this event:
     *
     * - Start playing ringback if it is an outgoing call
     */
  }

  onRNCallKitDidDisplayIncomingCall(error) {
    /* You will get this event after RNCallKit finishes showing incoming call UI
     * You can check if there was an error while displaying
     */
  }

  onRNCallKitDidPerformSetMutedCallAction(muted) {
    /* You will get this event after the system or the user mutes a call
     * You can use it to toggle the mic on your custom call UI
     */
  }

  // This is a fake function where you can receive incoming call notifications
  onIncomingCall() {
    // Store the generated uuid somewhere
    // You will need this when calling RNCallKit.endCall()
    let _uuid = uuid.v4();
    RNCallKit.displayIncomingCall(_uuid, "886900000000")
  }

  // This is a fake function where you make outgoing calls
  onOutgoingCall() {
    // Store the generated uuid somewhere
    // You will need this when calling RNCallKit.endCall()
    let _uuid = uuid.v4();
    RNCallKit.startCall(_uuid, "886900000000")
  }

  // This is a fake function where you hang up calls
  onHangUpCall() {
    // get the _uuid you stored earlier
    RNCallKit.endCall(_uuid)
  }

  render() {
  }
}

Original Author:

ianlin

License

ISC License (functionality equivalent to MIT License)

react-native-callkit's People

Contributors

aarkalyk avatar aatalyk avatar ianlin avatar killian90 avatar sagivo avatar sboily avatar sujameslin avatar zxcpoiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-callkit's Issues

Need Help - Getting error of Malformed call

    `ExceptionsManager.js:65` function () {
	var ret = '',
	    value;

	for (var i = 0; i < 32; i++) {
		value = exports.random() * 16 | 0;

		if (i > 4 && i < 21 && !(i % 4)) {
			ret += '-';
		}

		ret += (i === 12 ? 4 : i === 16 ? value & 3 | 8 : value).toString(16);
	}

	return ret;
},03244993387,number,false, is not usable as a native method argument
  ExceptionsManager.js:73 Malformed calls from JS: field sizes are `different.`

I have follow your guide. but now facing this error on function display incomming call.

Installation tip

Hello guys.

I have a problem with correct installation. You can see the error below.
When I try to use something like this:

    let _uuid = uuid.v4();
    RNCallKit.displayIncomingCall(_uuid, "886900000000");

Xcode error:

2018-01-18 21:57:21.495856+0200 calltravel[2858:1029881] n is not a function. (In 'n(e)', 'n' is undefined)
2018-01-18 21:57:21.496 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: n is not a function. (In 'n(e)', 'n' is undefined)
2018-01-18 21:57:21.496912+0200 calltravel[2858:1029907] Unhandled JS Exception: n is not a function. (In 'n(e)', 'n' is undefined)
2018-01-18 21:57:21.499252+0200 calltravel[2858:1029907] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: n is not a function. (In 'n(e)', 'n' is undefined)', reason: 'Unhandled JS Exception: n is not a function. (In 'n(e)', 'n' is undefined), stack:
<unknown>@405:2966
u@34:133
<unknown>@34:921
o@23:571
u@23:880
callImmediates@23:3178
value@18:2476
<unknown>@18:655
value@18:2304
flushedQueue@18:625
'
*** First throw call stack:
(0x1860dfd38 0x1855f4528 0x1860dfc80 0x104d66c08 0x104d64308 0x1860e76a0 0x185fc6820 0x185fcb22c 0x104d77790 0x104db787c 0x104db76e8 0x185a65088 0x185a65048 0x185a6ee48 0x185a6f7d8 0x185a70200 0x185a784a0 0x185d0afe0 0x185d0ac30)
libc++abi.dylib: terminating with uncaught exception of type NSException

I run that with:

		"react": "16.0.0-beta.5",
		"react-native": "0.49.3",
		"react-native-callkit": "^1.3.1",

I tried 1.3.0, 1.2.1 and I get same.

I also set up $(SRCROOT)/../node_modules/react-native-callkit/ios with recursive
And my AppDelegate.m looks like this

#import "AppDelegate.h"

#import "RNCallKit.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTPushNotificationManager.h>

#import <PushKit/PushKit.h>
#import "RNVoipPushNotificationManager.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

 /* RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"calltravel"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];*/
  // 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:@"calltravel"
                                                                      initialProperties:nil];

Sure there is also rncallkit.a in link binary with libs
What am I doing wrong? help pls

Video call flashes native UI

My understanding is that for video calls you route to your video components when answering an incoming call. Whenever I do that, the native UI flashes for a second before showing my component. Is there a way to prevent that?

No audio when running `startCall`

When I initiate an outgoing call from within my app, I call the startCall method (to register the call on the ios call history log). When I do this, I do not get audio (on either end of the call).

When I capture a network packet trace, I don't see any RTP being sent out by the device. My guess is, startCall is suppressing the audio.

Call audio works perfectly when no calling startCall.

CallKit uppercasing call uuid

If I call RNCallKit.endCall('ae708c43-f567-4bcf-8940-fb7013a8aa30'), the end call callback will get data with the uuid uppercased:

{ callUUID: 'AE708C43-F567-4BCF-8940-FB7013A8AA30' }

Is that expected?

incoming call not show when user kill app

currently it's only work for me when state is active and background, when user kill app not working to me, and then i open app again it's auto incoming call, so how to wake up app when state is inactive?i want to incoming call when user kill app.

How to run up the example?

Hi all,

I'd like to just run up an example first without sip setting.
I've settled down AppDelegate.m already.
App has been compiled and build successfully.

My purpose is just to render the incoming UI in current process.
How can I make it?

import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import RNCallKit from "react-native-callkit";
import uuid from "uuid";

export default class App extends Component<{}> {
  constructor(props) {
    super(props);
    RNCallKit.setup({ appName: "CALL_KIT" });
  }
  onIncomingCall() {
    // Store the generated uuid somewhere
    // You will need this when calling RNCallKit.endCall()
    let _uuid = uuid.v4();
    RNCallKit.displayIncomingCall(_uuid, "886900000000");
  }
  render() {
    return <View>{this.onIncomingCall()}</View>;
  }
}

The result is nothing happen in the simulator.

Thanks for any opinion.

Question / Handling permissions

Hey, @ianlin ! I wanted to ask about handling mic/camera permissions when user opens the app for the first time. The tricky part for me is user receiving a call for the first time when app is in background/killed mode. How do you handle such cases? What are the best practices?
Thanks in advance!

Speaker buton event

Is it possible to add an event for speaker button such as didPerformSetSpeakerCallAction (like didPerformSetMutedCallAction)

Show custom UI after answer call from lock screen

If a user answers a call from the lock screen, they will see the native iPhone call UI instead of the custom UI the app displays.

They then have to click the button on the bottom right with the app name ("HDC" in the screenshot) to see the app UI.

If the phone is unlocked, answering the call allows you to route to the app UI. Is there a way we can display app UI after a user answers the call from the lock screen or do you not have permission for some reason since the phone is locked?

How to properly set up.

I've installed and linked the npm package, added the build phases, replaced the code in AppDelegate.m. Should I add the file RNCallKit.h and paste this code inside?;
I'm getting errors for missing context for method declaration, use of undeclared identifier RNCallKit and use of undeclared identifier rncallkit.

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
  restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
{
  return [RNCallKit application:application
           continueUserActivity:userActivity
             restorationHandler:restorationHandler];
}

call failed screen appears after answering the call

i'm able to make the callkit incoming call ui appears
but after clicking the answering button a call failed screen appears and the app restarts
any idea how to solve it

the expected behavior is to execute whatever in the call answer listener
without the call failed screen to appear

CallKit actions not always getting executed.

Hey, thanks for the package.

I am seeing a couple of different issues while using the library.

  • It seems that actions are not always fulfilled or called. Sometimes after CallKit.endCall the phone still thinks there is a call active and gets confused.
  • CallKit.displayIncomingCall often it will instantly flash the ui as an overlay and then show the app, and then show the actual overlay. This can also be seen by the many triggers of AppState changes.
  • AVAudioSession It is not clear to me how this works together with pjsip. Also it seems that the created audio session is not destroyed.
  • Trying to end a call after CallKit.displayIncomingCall sometimes does nothing. Even though the uuids are the same.

voip-push-notification Integration

Can both packages be used together ? , Ive implemented react-native-voip-push-notification with my app and its working great, but can I bring call-kit upfront on a voip-push receival ?

Thanks in advance.

onRNCallKitPerformEndCallAction not being called after call rejection.

On Reject call from call kit view, unable to call this listener on Testflight.

RNCallKit.addEventListener('endCall', this.onRNCallKitPerformEndCallAction);

What can be the issue ?
It is calling successfully after answered call, ended from callkit view. But not when rejected the call directly.

Speakerphone

Hello, I have an issue. The button to switch the audio channel deactivates . The button will go into inactive state.
ezgif com-video-to-gif

Using imageName

I've tried using the imageName property but I can't get it to display on an incoming call.

I've tried using an image name in my react-native bundle as well as an image in Images.xcassets. Would you mind elaborating on how one would add an image to the bundle?

help setting up event listener?

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!

bug: RNCallKit.endCall(_uuid) is not disconnecting the call

I'm integerating my app with react-native-pjsip library and I've used react-native-callkit for call-kit handling. When remote user hangup the call then my react-native-pjsip's endpoint method notify me to terminate the call so I'm calling RNCallKit.endCall(_uuid) but it's not disconnecting the call from my screen

Debug: I've thought that maybe RNCallKit.endCall and RNCallKit.startCall is getting different _uids but after printing out the results it's the same _uuid = "cec47dc0-4017-11e9-b085-e3a9fec010a6".

Please let me know If I'm doing anything wrong

Is it possible to call using other than phone number

Hi,

I'm doing chat application in which there is an option for video call. For this i have integrated react-native-video-webRTC.But instead of connecting directly i need acept reject and call getting notifications as well. So i'm looking for some call kit frameworks like this. but here is it possible to make call without any phone number. Because i must not use phone number. i need to do it based on roomId. Is there that kind of possiblity with this framework.

If yes, how?

how to sip integration

hello ,

how to sip voip server url and user , password integration
usage sip server system asterisk elastix

Is it possible to get icomming call number?

My goal is getting phone number of incomming call(React Native - iOS).
First, I found a 'react-native-call-detection' module. That was able to get incomming phone number but only in Android OS.
So i wondering that i can get incomming phone number using this module.

How to flag an outgoing call as "Video"

First off, deep thanks for a great plugin and your contributions to the react-native community!

I'm making a videochat application. When my app receives an incoming I call displayIncomingCall() with hasVideo = true. in Recents I see the incoming call flagged as Video which is nice. When registering an outgoing call with startCall() I don't have that option though.. and in Recent it shows up as Audio. Is there a way to start an outgoing call and flag it as Video?

Error : "Native module cannot be null."

I have tried with version 1.3.4

by the following step I did.

  • yarn add react-native-callkit
  • react-native link react-native-callkit
  • $(SRCROOT)/../node_modules/react-native-callkit/ios/RNCallKit in header search path with recursive.
  • #import "RNCallKit.h" in AppDelegate.m
  • Linking Lib. with Intents.framework and CallKit.framework as optional

Do I missed any further step to complete it?

Expected Result : Application can run without any errors.
Behavior Result : Application run with error as I mentioned "Native module cannot be null."

Dependencies :
"dayjs": "^1.7.4",
"lodash": "4.17.10",
"mobx": "3.4.1",
"mobx-react": "4.3.5",
"mobx-state-tree": "1.3.1",
"native-base": "2.7.2",
"opentok-react-native": "^0.8.2",
"prop-types": "^15.6.2",
"react": "16.2.0",
"react-native": "0.51.0",
"react-native-callkit": "^1.3.4",
"react-native-camera": "^1.1.4",
"react-native-code-input": "^1.0.6",
"react-native-country-picker-modal": "^0.6.2",
"react-native-credit-card-input": "^0.4.1",
"react-native-gifted-chat": "^0.4.3",
"react-native-google-analytics-bridge": "^5.8.0",
"react-native-image-picker": "^0.26.10",
"react-native-loading-spinner-overlay": "^0.5.2",
"react-native-modal": "^6.5.0",
"react-native-onesignal": "^3.2.5",
"react-native-permissions": "^1.1.1",
"react-native-phone-input": "^0.2.1",
"react-native-qrcode": "^0.2.7",
"react-native-splash-screen": "^3.1.1",
"react-native-ui-xg": "^0.0.6",
"react-navigation": "^2.9.3",
"sendbird": "^3.0.69",
"socket.io-client": "^2.1.1",
"timeago.js": "^3.0.2",
"uuid": "^3.3.2",
"voca": "^1.4.0"
screen shot 2018-08-07 at 17 26 32
screen shot 2018-08-07 at 17 26 49
screen shot 2018-08-07 at 17 27 44

Problems with didReceiveStartCallAction-event

I have a number of call-kit-calls listed by my app under the Recent-tab on my iPhone.

In my app-code I hook into the didReceiveStartCallAction-event like this:

  RNCallKit.addEventListener("didReceiveStartCallAction", data => {
        console.log("didReceiveStartCallAction", data);
   });

When I click a call in Recent-list my app starts, but the above event isn't executed (other callbacks like answerCall and endCall works)

Any ideas why?

Integrating with RNN

Hi there! Great work on the lib!

I'm not an iOS dev and I'm having some problem to integrate this with react-native-navigation
For the other lib, I need to do this

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  // Initialise RNCallKit
  RNCallKit *rncallkit = [[RNCallKit alloc] init];
  
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.window.backgroundColor = [UIColor whiteColor];
  
  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];
  
  self.oneSignal = [[RCTOneSignal alloc] initWithLaunchOptions:launchOptions
                                                         appId:@"oneSignalId"];

  /*
  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"myApp"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  */
  return YES;
}

I'm trying to init your lib and import it as a NativeModule, but on react-native I receieve the error Native Modules cannot be null

Any idea on how to properly link your lib as Native Module?

delay call connection

On answering a call, the call is set as connected regardless of the actual status of the VOIP connection.

Currently, you can accept an incoming call without implementing the answerCall method and still get to the call connected state.

Is it possible to halt the answer's [action fulfill] until connection is complete?

Hang up on incoming calls

Hi,

I'm building a react-native app which utilizes twilio video for webrtc calls.

I'm attempting to use pushkit and callkit just to permit my app to ring while in the background, and then, after the receiver answers, swap over to the video interface I've built.

This is all working with this package. Thanks so much for building this great tool!

My problem: I cannot figure out how to have my app signal to callkit to shut the call off, after the call ends in the app.

The video call in the app ends, but the call kit call is still going.

I can manually end the call, but it feels sloppy and redundant.

I tried for hours to get the "endcall" method working, only to see after the fact, that it is designed for OUTGOING calls. Is there any easy way to do the same for INCOMING calls? I tried the endAllCalls method, but it is not working either.

Thanks!

Conflicting parameter types

Hi,

Xcod is showing this warning:
" Conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:':'void (^_Nonnull __strong)(NSArray<id>*_Nullable __strong)' vs 'void (^__strong _Nonnull)(NSArray *_Nullable __strong)' "

on this line in AppDelegate.m:
restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler

How do I fix this mismatch?

Callkit UI doesn't appear for outgoing calls.

After making a call through endpoint, I am calling RNCallKit.startCall like this. But, screen remains the same as dial screen and system ui doesn't show up. What am I doing wrong?

    endpoint.makeCall(account, destination).then(
      call => {
        if (isIOS) {
          const _uuid = uuid.v4();
          this.setState({ uuid: _uuid });
          RNCallKit.startCall(_uuid, call.getRemoteFormattedNumber());
        }
      },
      error => {
        console.log(error);
      },
    );

Thank you!

Weird: RNCallkit is not defined

Hello, I got an error RNCallkit while trying to import from JS file.

I already link this library manually by:

  1. Drag RNCallKit.xcodeproj into Libraries
  2. Add $(SRCROOT)/../node_modules/react-native-callkit/ios/RNCallKit (recursive) in project's Header Search Path
  3. Add libRNCallkit.a, CallKit.framework, Intent.framework into project's Build Phases
  4. Modify AppDelegate.m to #import "RNCallKit.h" and Handling User Activity
  5. Trying to clean & re-build several times, restart Mac, but still doesn't work

I'm using RN 0.52.1, installing on my real device iPhone 5s, use RNCallkit 1.3.1.

CallKit UI not showing when i use displayIncomingCall

First of all i do the setup calling this function: RNCallKit.setup({appName: 'App'});
Then I am calling this function: RNCallKit.displayIncomingCall("_uuid", "886900000000") when the phone is locked or when I'm on the home screen and the UI it's not showing up. I debugged it and it calls the function but it doesn't do anything.

Thanks

Guidance for a PR

Hi, I'm not an Objective-C developer and I'm pretty new to React-Native native modules so I need some guidance to reach a specific goal that I think should benefit the project greatly.

On all callbacks in which we receive actions such as CXAnswerCallAction (on performAnswerCallAction), while inspecting the object, I saw that we're able to fetch the UUID of the call that is being acted upon.

Adding that parameter to the event would be of much use to the application that is trying to deal with multiple calls. Despite my efforts, I wasn't able to get this to work and I'm sure I must be missing something rather simple. Here's the modification I've made:

// Answering incoming call
- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action
{
#ifdef DEBUG
    NSLog(@"[RNCallKit][CXProviderDelegate][provider:performAnswerCallAction]");
#endif
    if (![self lessThanIos10_2]) {
        [self configureAudioSession];
    }
    [self sendEventWithName:RNCallKitPerformAnswerCallAction body:(@{ @"callUUID" : (action.callUUID.UUIDString) })];
    [action fulfill];
}

I have no problem doing the work but I need some guidance towards what I'm missing here. Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.