react-native-webrtc / react-native-callkeep Goto Github PK
View Code? Open in Web Editor NEWiOS CallKit framework and Android ConnectionService for React Native
License: ISC License
iOS CallKit framework and Android ConnectionService for React Native
License: ISC License
Just adding callkeep to a project and I'm getting an error
Gradle sync failed: Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar
Consult IDE log for more details (Help | Show Log) (6s 297ms)
Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar
It looks like the latest version available is
https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/build/manifest-merger/25.3.0/
Completely flumoxed as to why this is even happening - I've used callkeep in another projects fine
Hi, is there a way to use a custom UI for incoming call and call screen instead of native?
To show incoming call screen we call
To close incoming call screen we call
It works great for the first time.
### But -------------------------------------------------------------------------------
when we receive a new call and again do the same flow:
- RNCallKeep.setup(options)
- createNewUdid()
- RNCallKeep.displayIncomingCall(getCurrentUuid() .......)
and when we need to close the incoming call screen by
RNCallKeep.endCall(getCurrentUuid()) it is not working.
But if I answer within the app, its fine.
I set the active flag when the call gets answered.
Will have a look into this today/next week - just wanted to raise it as an issue
i receive voip notifications and callkit incoming call ui appears but after answering a call failed screen appears then restart the app
On some Samsung devices there is a problem when a default calling account has not been chosen. When a call is made from the Phone app, the call with dialog should show the SIM and the CallKeep app but it is blank.
This has been reproduced on Samsung S9 with Android 9 (but was fixed in a security patch from Samsung) and Samsung Note 9 with Android 9 (no security patch available yet), but works correctly on Samsung S8 with Android 9.
I know this is not a problem with the library and is a Samsung OS issue, but a possible workaround could be checking if a default is set (with telecomManager.getDefaultOutgoingPhoneAccount("tel")
) and sending the user to the calling accounts settings (TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS
) for them to set a default.
Hi,
I am using this plugin to show incoming video call ui into react-native, I am trying to display a incoming call UI as per document I used this function after installing plugin and linked.
RNCallKeep.displayIncomingCall(uuid.v4(), '44534534543', 'jaawant','number', true);
I also tried old comments on display incoming call and follow instructions but there was no luck.
I also updated this into RNCallKeep.m file
callUpdate.hasVideo = hasVideo;
Please help me , as it is not showing any error so can't fix it.
Thanks in advance.
I got no sound when I answer with callkit. Do you know why this can be?
Everything works if I use
RNCallKeep.startCall(session.ID, "User", 'generic');
But it doesn't work when I answer from native UI
RNCallKeep.displayIncomingCall(session.ID, user.username, user.username, 'generic', isVideoCall);
The problem is related with this actually.
react-native-webrtc/react-native-callkit#45
Sometimes connection keeps long so I want to show users that it is still connecting but when I do that
no one can hear each other. To solve that I am doing disabling & enabling microphone on receiver. Now caller can hear receiver but receiver can't hear caller. Is there a better way to apply this PR?
import com.wazo.callkeep.RNCallKeepPackage;
to
import io.wazo.callkeep.RNCallKeepPackage;
I've got an issue on a fresh install of the app (or one where i remove the permission to make phone calls)
On fresh install load I get a OS alert asking for permission to make phone calls, I approve and then nothing happens after that.
If I then close the app and restart it, I then get the custom Alert box saying "we need you the phone account", you press ok and it takes you through to the phone accounts settings.
My feeling is that the custom Alert should happen straight after the requested making a phone call permission. I'm going to investigate this a bit today but wanted to make an issue on how to recreate it.
I'm running RNCallKeep.setup within componentDidMount()
I can't start my app with this error PhoneAccount connection service requires BIND_TELECOM_CONNECTION_SERVICE permission. I get all permissions. How can I fix it?
I'm integerating my app with react-native-pjsip
library and I've used react-native-callkeep
for call-kit handeling. When remote user hangup the call then my react-native-pjsip
's endpoint method notify me to terminate the call so I'm calling RNCallKeep.endCall(uuid)
but it's not disconnecting the call from my screen
Debug: I've thought that maybe RNCallKeep.endCall
and RNCallKeep.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
@manuquentin can you help me?
what android supported version by this library ?
i run the app on android V 4.4.4 it crash
i run it on android V 5.1 it run's perfectly
@manuquentin
Not a big deal, but when running
react-native link react-native-callkeep
We get
import com.wazo.callkeep.RNCallKeepPackage;
instead of
import io.wazo.callkeep.RNCallKeepPackage;
in our MainApplication.java
This prevents from building the app on android.
Should the line:
"Tell ConnectionService that the device is ready to accept outgoing calls"
not read:
"Tell ConnectionService that the device is ready to accept incoming calls"?
I should be able to make the alert look and feel like the rest of my app - for example using Modal from react-native-paper
I have everything working and the call coming through to my device but when I call RNCallKeep.endCall(callUUID);
this doesn't dismiss the native call screen.
I have it wrapped in a timer so if there's no answer after 20seconds the call should stop but it isn't working
Can anyone help?
For now when the user change the speaker output, we don't have any event for that.
We need also a method to tell CallKeep to change the speaker button when we change it in the application.
Allow the removal of all event listeners for a particular event.
On a samsung s8 and when i decline a call through connection manager I don't get an endCall event like I do on ios
Making the issue in case someone else has had this issue - just about to take a look into the code and see if I can figure out whats happening
If your app is able to handle multiple calls, how do you decide which to terminate? Lets say you have an active call and and inbound call.
How do you know which call is being ended? Should we be using
ACTION_HANGUP_CALL
and ACTION_REJECT_CALL
Feels like I can take a stab at doing the right thing but there will be edge cases where I'm unable to choose which call I should be ending - right?
Or can we get a callId in the event like there is on ios - which would make this like for like
Just trying to work out whats needed to utilise the new callkit ios flag in RN-WebRTC 75 and realised we still don't support performSetGroupCallAction
I plan on submitting a PR for it but making the issue so it doesn't get forgotten about
Trying to do
RNCallKeep.displayIncomingCall
but always popup the Permission required,
what's the phone account enable mean?
using ASUS (Android 7.0) dual-sim device with 1 sim-card,
any suggestion? thanks.
Will make debugging easier
I'll do a PR later
Hi, guys.
I have tried more times to debug catch events and output result, but all RNCallKeep.addEventListener subscriptions are not working.
Maybe I have some missing configuration?
I am testing TextNow voip services on my phone and mac.
Here is my code.
import React, { Component } from 'react';
import {
View,
Dimensions,
PermissionsAndroid,
Platform,
Text,
TouchableOpacity
} from 'react-native';
import PropTypes from 'prop-types';
import Contacts from 'react-native-contacts';
import Icon from 'react-native-vector-icons/FontAwesome';
import RNCallKeep from 'react-native-callkeep';
import uuid from 'uuid';
import { AppContext, Navbar } from 'app/components';
import styles from './style';
const dm = Dimensions.get('screen');
class MainScreen extends Component {
constructor(props) {
super(props);
this.state = {
lastCallNumber: ''
};
this.currentCallId = null;
// Initialise RNCallKeep
const options = {
ios: {
appName: 'Nope'
},
android: {
alertTitle: 'Permissions required',
alertDescription:
'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'ok'
}
};
try {
RNCallKeep.setup(options);
RNCallKeep.setAvailable(true); // Only used for Android, see doc above.
} catch (err) {
console.error('initializeCallKeep error:', err.message);
}
// Add RNCallKeep Events
RNCallKeep.addEventListener('didReceiveStartCallAction', this.onNativeCall);
RNCallKeep.addEventListener('answerCall', this.onAnswerCallAction);
RNCallKeep.addEventListener('endCall', this.onEndCallAction);
RNCallKeep.addEventListener(
'didDisplayIncomingCall',
this.onIncomingCallDisplayed
);
RNCallKeep.addEventListener(
'didPerformSetMutedCallAction',
this.onToggleMute
);
RNCallKeep.addEventListener(
'didActivateAudioSession',
this.audioSessionActivated
);
}
onNativeCall = ({ handle }) => {
// Your normal start call action
alert('call');
RNCallKeep.startCall(this.getCurrentCallId(), handle);
};
onAnswerCallAction = ({ callUUID }) => {
// called when the user answer the incoming call
};
onEndCallAction = ({ callUUID }) => {
RNCallKeep.endCall(this.getCurrentCallId());
this.currentCallId = null;
};
onIncomingCallDisplayed = (error) => {
alert('call');
// You will get this event after RNCallKeep finishes showing incoming call UI
// You can check if there was an error while displaying
};
onToggleMute = (muted) => {
// Called when the system or the user mutes a call
};
audioSessionActivated = (data) => {
// you might want to do following things when receiving this event:
// - Start playing ringback if it is an outgoing call
};
getCurrentCallId = () => {
if (!this.currentCallId) {
this.currentCallId = uuid.v4();
}
return this.currentCallId;
};
async componentDidMount() {
this.reload();
if (Platform.OS === 'android') {
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_CONTACTS, {
title: 'Contacts',
message: 'This app would like to view your contacts.'
}).then(() => {
Contacts.getAll((err, contacts) => {
if (err === 'denied') {
// error
throw err;
} else {
// contacts returned in Array
this.parseContacts(contacts);
}
});
});
} else {
Contacts.getAll((err, contacts) => {
if (err) {
throw err;
}
// contacts returned
});
}
}
reload = async () => {
await this.context.showLoading();
this.context.hideLoading();
};
leftHandler = () => {
this.props.navigation.toggleDrawer();
};
upVote() {
alert('Yep!');
}
downVote() {
alert('Nope!');
}
render() {
return (
<View style={styles.container}>
<Navbar
left="ios-menu"
leftHandler={this.leftHandler}
title="Dashboard"
/>
<View style={styles.container}>
<Text style={styles.title}>Nope</Text>
<Text style={styles.description}>Please rate the calls below:</Text>
<View style={styles.box}>
<Text style={styles.description}>Was this call legit?</Text>
<Text style={styles.description}>{this.state.lastCallNumber}</Text>
</View>
<View style={styles.voteBox}>
<View style={styles.leftBox}>
<TouchableOpacity onPress={() => this.upVote()}>
<Text style={styles.voteTitle}>
Yep
<Icon name="thumbs-up" size={30} color="grey" />
</Text>
</TouchableOpacity>
</View>
<View style={styles.rightBox}>
<TouchableOpacity onPress={() => this.downVote()}>
<Text style={styles.voteTitle}>
Nope!
<Icon name="thumbs-down" size={30} color="grey" />
</Text>
</TouchableOpacity>
</View>
</View>
</View>
</View>
);
}
}
MainScreen.contextType = AppContext;
MainScreen.propTypes = {
navigation: PropTypes.object
};
export default MainScreen;
iOS and Android packages are correctly imported and running without any errors.
But can't catch event as I desired.
Thanks.
Hi there,
Are you guys available for a paid task?
Please contact me: hiappstudio at gmail dot com
With the update in master, we get the event into the background service and then open up the app from there with the uuid for connection service. If I run startCall I get the connection service UI but I don't get a start call event. I have to assume that the event isn't going to happen and force the call to happen as though I got the start call action.
How did you envisage this working @manuquentin ?
Should the underlying callkeep code show the UI as though you've called startCall ?
Oh looks like this does actually act like this... and I was getting confused due to reloading the RN App inside the app during debugging
When using installation with cocoapods steps, pod installation fails with this error.
I can display coming call successfully. But in iOS, the caller name display without any space. Android works fine
I have a function that is being called when I get a notification but I can't get it to say Video and not audio. Bellow is the function
onIncomingCall(callUuid) {
RNCallKeep.displayIncomingCall(callUuid, "Thomas Large", null, true);
}
True is the way the docs tells you how to set it
Can anyone help?
In order to allow multiple calls with callkeep, we need to do some modifications.
This issue is intended to list all resources about this subject.
The react-native-callkeep library works when the app's JS is active (open/backgrounded for Android, open for iOS). However, the react-native-callkeep JS API, as documented in the readme, doesn't work when the app is in the other states (killed for Android, backgrounded/killed for iOS).
Can react-native-callkeep possibly be made to work in those scenarios (i.e. from a push notification via a native notification service, etc.)?
I got this issue while trying to add lib. Could anyone help me out
@manuquentin
UPDATE: This is now a feature request. Can react-native-callkeep be updated so that it can be used with setConnectionProperties(PROPERTY_SELF_MANAGED)
?
Our use case is this: we have a cross-platform video chat app that uses opentok-react-native, and we currently use just push notifications to get users to pair with each other (using react-native-onesignal). When our users tap the push notification, they simply get dropped into our app.
We would instead want these video chat requests to look like phone calls. This means that we want the phone-call-esque screen to just act as a glorified push notification (tapping the answer button would trigger the exact same behavior that our push notification currently triggers -- opening the app, nothing more and nothing less).
It seems to me that such a functionality must be possible to do in CallKit and ConnectionService without all the other things that other typical VoIP apps need. For example, requesting the BIND_TELECOM_CONNECTION_SERVICE
permission on Android shouldn't be needed, and it would be great to not have to show this to the user. (Or I may be misunderstanding ConnectionService.)
Is it possible to use react-native-callkeep
as something like a full-screen push notification that just happens to look like an incoming phone call?
I'm looking for a better incoming call-notification than push notifications for a WebRTC videocalling app, when i read the readme it is not immediately clear for me what happens on ios and android when the answer button is pressed?
Will my app be opened with some extra data?
Can we use it with WebRTC (and custom UI) instead of VOIP?
Can it be used when app is not active or in background?
Aside from this., great that someone converted the callkit lib into a cross platform one! I really hate one platform react-native packages or packages that behave completely different on both platforms!
I am getting TypeError: null is not an object (evaluating 'RNCallKeepModule.setAvailable')
, with remote debugging turn off and TypeError: Cannot read property 'setAvailable' of undefined
with remote debugging on.
import RNCallKeep from 'react-native-callkeep';
const App = () => {
const options = {
ios: {
appName: 'My app name',
},
android: {
alertTitle: 'Permissions required',
alertDescription: 'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'ok',
},
};
RNCallKeep.setup(options);
RNCallKeep.setAvailable(true);
return (
<Fragment>
<Text>
hello
</Text>
<Button title="Press Me" />
</Fragment>
);
};
This repo has no dependencies so why is there a yarn lockfile? I feel as though its causing issues with conflicting dependencies but I can't 100% put my finger on it. Anyway..... why the yarn.lock ?
"react-native-callkeep": "^2.0.3"
"react-native-webrtc": "^1.75.0"
I am not receiving any audio when I answer an inbound call on iOS (android is fine). I do get the following in the logs.
[RNCallKeep][configureAudioSession] Activating audio session
[RNCallKeep][CXProviderDelegate][provider:didActivateAudioSession]
Hello. Can I show custom ui after answer call like in ios if app in background or killed?
Hi,
I have set up callkeep for iOS platform but I'm able to see only some screens.
For example I can see Incoming call screen without problems. But when I run this line of code RNCallKeep.startCall('b0074838-a352-11e9-a2a3-2a2ae2dbcce4', '123456789');
I can't see start call screen on the iPhone, moreover, when I set app in background I can see iPhone's status bar in green indicating that there is a call running, but when I click there only open my app and not the callKit screen. There are no errors in Xcode console and the logs are ok.
Could be a phone setup problem? Any clue or tip?
Hello everybody. Is there a way to show custom UI after answering call on android, e.g. open application with custom UI, instead of being stuck on Android`s default incall screen?
Hi,
I don't know if this is the standard behavior but, when I accept the call on iOS through the native phone screen, it is minimized and it goes to my app screen. I see the native phone UI on the tray. Is there some way to configure to have this call activity screen don't minimize?
Many thanks.
Hi Callkeep team,
I'm getting this error on android when running the sample code. I tried to unlink and link the package again, and finally checked everything manually, but it keeps happening.
This error disappears if i manually authorize my app to access the phone (settings -> Apps permissions -> myapp -> permissions -> phone).
Any idea ?
Manu
react-native-cli: 2.0.1
react-native: 0.59.5
Please add add setup instructions for React Native 0.06.XX to the readme.
ios has onHold
and android has hold
so I'm having to do
let tmpHold = Platform.OS === 'android' ? data.hold : data.onHold;
We should make it the same
Calling using callkeep integration on android works great when the android app is open. If its closed, it doesn't work. It opens the native GUI for making an outbound call but then gives up.
Tried to look through the logs and figure out whats missing but it doesn't make too much sense to me. Got any pointers?
I'm assuming I need to put another intent filter for MainActivity into AndroidManifest but I'm a JS dev, not a native one
RNCallKeep.endAllCalls() not working
So that its the same as the other events
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.