Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deviceNotReady error : "Registration failed" #148

Closed
ArchanaSharma95 opened this issue Mar 27, 2020 · 3 comments
Closed

deviceNotReady error : "Registration failed" #148

ArchanaSharma95 opened this issue Mar 27, 2020 · 3 comments

Comments

@ArchanaSharma95
Copy link

ArchanaSharma95 commented Mar 27, 2020

I have done server setup in php. But getting "Registration failed" error in 'deviceNotReady" listener.
This is a function I am calling on click of number:

initTwilio = async () => {
	const token = await this.getAuthToken();
	if (Platform.OS === 'android') {
		await this.getMicrophonePermission();
	}
	const success = await TwilioVoice.initWithToken(token);
	if (success.initialized) {
		TwilioVoice.addEventListener('deviceReady', () => {
			this.setState({ twilioInited: true });
		});
		TwilioVoice.addEventListener('deviceNotReady', function (data) {
			console.log('data', data) // getting error here
		});
		if (Platform.OS === 'ios') { //required for ios
			TwilioVoice.configureCallKit({
				appName: 'ReactNativeTwilioExampleApp',
			});
		}
	}
};

getAuthToken = () => {
	return fetch('https://myurl/accessToken.php', {
		method: 'get',
	})
	.then(response => response.text())
	.catch((error) => console.error(error));
}

Please help I am new to this.

@walosha
Copy link

walosha commented Apr 18, 2020

You probably made a typo when setting up the twillo key on the backend. This particular happened to me when I couldn't generate the API secret and API secret key well. I hope it helps

@pruthvirajkarur
Copy link

@ArchanaSharma95 Were you able to get the solution. I am also facing same issue. err: "Registration failed" getting this response in deviceNotReady event listner

@jdegger
Copy link
Collaborator

jdegger commented Oct 27, 2020

Hi, since a long time has passed I will be closing this issue. Read our repository update in #158. I invite you to reopen this issue when you still have problems so we can debug the problems together.

@jdegger jdegger closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants