Closed murugancmi closed 7 years ago
Hi, did you link library ?
react-native link
yes i did that
rnpm-install info Android module react-native-pjsip is already linked rnpm-install info iOS module react-native-pjsip is already linked rnpm-install info Linking assets to ios project rnpm-install info Linking assets to android project rnpm-install info Assets have been successfully linked to your project
Is Endpoint
undefined ? Did you rebuild app after linking ? Which platform (iOS/Android) ?
Yes Endpoint undefined No let me rebuild Android
After rebuild there is no warning message but nothing happen,Mean register event not fired
when i try react-native run
Unrecognized command 'run' Run react-native --help to see list of all available commands
May be react-native start :)
Yeap, react-native run
should solve the problem :)
After rebuild there is no warning message but nothing happen,Mean register event not fired
when i try react-native run
Unrecognized command 'run' Run react-native --help to see list of all available commands
May be react-native start :)
Oh, yeap, I mean run-android
. You can explore error inside device logs adb logcat
.
when i try to start endpoid i am getting following warn in my console and i never get any event
Possible Unhandled Promise Rejection (id: 1): Cannot read property 'start' of undefined TypeError: Cannot read property 'start' of undefined
bellow is my code
import {Platform, PushNotificationIOS, AppState} from 'react-native' import {Endpoint} from 'react-native-pjsip'
const telecmi={}
telecmi['startAgent']= async function(username,password) {
let endpoint = new Endpoint(); console.log(endpoint) let state = await endpoint.start(); // List of available accounts and calls when RN context is started, could not be empty because Background service is working on Android let {accounts, calls, settings, connectivity} = state;
let configuration = { "name": "John", "username":'xxxxxxx', "domain": "voip.telecmi.com", "password":'xxxxxxx', "proxy": null, "transport": null, // Default TCP "regServer": null, // Default wildcard "regTimeout": null // Default 3600 }; endpoint.createAccount().then((account) => { alert(account) console.log("Account created", account); });
endpoint.on("registration_changed", (account) => {
console.log(account) });
}
export default telecmi;