Add geolocation and country fetching features; update API endpoints
This commit is contained in:
parent
1fdda31b81
commit
71f6af4766
|
@ -102,8 +102,11 @@ export default class CreateUserStep2 extends Component {
|
||||||
|
|
||||||
retreiveCodeInformation() {
|
retreiveCodeInformation() {
|
||||||
const membre = this.state.user.member;
|
const membre = this.state.user.member;
|
||||||
|
console.log("membre===>> ", membre);
|
||||||
|
console.log("1===>>");
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let datas = await getCodeInformation(membre)
|
let datas = await getCodeInformation(membre)
|
||||||
|
console.log("datas===>> ", datas);
|
||||||
resolve(datas)
|
resolve(datas)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -145,9 +148,10 @@ export default class CreateUserStep2 extends Component {
|
||||||
if (indicatif) {
|
if (indicatif) {
|
||||||
let result = {}
|
let result = {}
|
||||||
try {
|
try {
|
||||||
|
console.log("RESULTAT1===>> ", indicatif);
|
||||||
result = await this.retreiveCodeInformation()
|
result = await this.retreiveCodeInformation()
|
||||||
const {category} = result
|
const {category} = result
|
||||||
console.log("RESULTAT ", result);
|
console.log("RESULTAT===>> ", result);
|
||||||
this.setState({result});
|
this.setState({result});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
result = false
|
result = false
|
||||||
|
@ -178,7 +182,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
console.log("need enable")
|
console.log("need enable")
|
||||||
getCountryNetwork(indicatif).then((result) => {
|
getCountryNetwork(indicatif).then((result) => {
|
||||||
this.reseaux = [];
|
this.reseaux = [];
|
||||||
let networks = result;
|
let networks = result;;
|
||||||
|
|
||||||
for (let prop in networks) {
|
for (let prop in networks) {
|
||||||
if (networks[prop] !== "") {
|
if (networks[prop] !== "") {
|
||||||
|
@ -246,7 +250,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.fetchCountries();
|
||||||
this.mounted = true;
|
this.mounted = true;
|
||||||
const {type} = this.props;
|
const {type} = this.props;
|
||||||
|
|
||||||
|
@ -260,6 +264,93 @@ export default class CreateUserStep2 extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
getCountryByLocation = async (countriesArray) => {
|
||||||
|
try {
|
||||||
|
// Vérification des permissions Android
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
const granted = await PermissionsAndroid.request(
|
||||||
|
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION
|
||||||
|
);
|
||||||
|
|
||||||
|
if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
|
||||||
|
return this.findDefaultCountry(countriesArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Récupération de la position
|
||||||
|
const position = await new Promise((resolve, reject) => {
|
||||||
|
Geolocation.getCurrentPosition(resolve, reject, GEOLOCATION_OPTIONS);
|
||||||
|
});
|
||||||
|
// Reverse geocoding
|
||||||
|
const geocodeResponse = await getPositionInformation(position.coords);
|
||||||
|
const countryComponent = geocodeResponse.results[0]?.address_components?.find(
|
||||||
|
c => c.types.includes("country")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!countryComponent) return this.findDefaultCountry(countriesArray);
|
||||||
|
|
||||||
|
// Recherche dans le tableau
|
||||||
|
const foundCountry = countriesArray.find(
|
||||||
|
country => country.code_country === countryComponent.short_name
|
||||||
|
);
|
||||||
|
return foundCountry || this.findDefaultCountry(countriesArray);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Erreur de géolocalisation:', error);
|
||||||
|
return this.findDefaultCountry(countriesArray);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fonction helper pour trouver le Cameroun
|
||||||
|
findDefaultCountry = (countriesArray) => {
|
||||||
|
return countriesArray.find(c => c.code_country === "CM") || countriesArray[0];
|
||||||
|
};
|
||||||
|
fetchCountries = async () => {
|
||||||
|
try {
|
||||||
|
const response = await getListCountriesActive();
|
||||||
|
|
||||||
|
let countriesData = [];
|
||||||
|
if (response.error === "error" && response.error_msg) {
|
||||||
|
const jsonMatch = response.error_msg.match(/\[.*\]/);
|
||||||
|
if (jsonMatch) {
|
||||||
|
countriesData = JSON.parse(jsonMatch[0]);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
countriesData = response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const formattedCountries = countriesData.map(country => ({
|
||||||
|
label: country.name,
|
||||||
|
value: country.name,
|
||||||
|
code_dial: country.code_dial,
|
||||||
|
code_country: country.code_country
|
||||||
|
}));
|
||||||
|
const detectedCountry = await this.getCountryByLocation(formattedCountries);
|
||||||
|
this.setState({
|
||||||
|
country: formattedCountries,
|
||||||
|
countries: formattedCountries[0],
|
||||||
|
isLoading: false,
|
||||||
|
selectedCountry: detectedCountry, // Sélectionne le premier pays par défaut
|
||||||
|
indicatif: detectedCountry?.code_dial
|
||||||
|
});
|
||||||
|
this.getNetworks(detectedCountry.code_dial);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Erreur lors de la récupération des pays:', error);
|
||||||
|
this.setState({ isLoading: false });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleCountryChange = (value, index, data) => {
|
||||||
|
const selectedCountry = this.state.countries[index];
|
||||||
|
this.setState({
|
||||||
|
selectedCountry: selectedCountry,
|
||||||
|
indicatif: selectedCountry.code_dial,
|
||||||
|
network: null
|
||||||
|
});
|
||||||
|
this.getNetworks(selectedCountry.code_dial);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
async requestGeolocationPermission() {
|
async requestGeolocationPermission() {
|
||||||
try {
|
try {
|
||||||
|
@ -393,7 +484,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
latitude: position.coords.latitude,
|
latitude: position.coords.latitude,
|
||||||
longitude: position.coords.longitude
|
longitude: position.coords.longitude
|
||||||
}, () => {
|
}, () => {
|
||||||
console.log("latitude", this.state.latitude);
|
|
||||||
});
|
});
|
||||||
if (this.result.child) {
|
if (this.result.child) {
|
||||||
this.setState({disableNetwork: true});
|
this.setState({disableNetwork: true});
|
||||||
|
@ -437,104 +528,159 @@ export default class CreateUserStep2 extends Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
treatPosition(position) {
|
// treatPosition(position) {
|
||||||
const myLastPosition = this.state.myPosition;
|
// console.log("debugTreatPosition1===>>")
|
||||||
|
// const myLastPosition = this.state.myPosition;
|
||||||
|
// const myPosition = position.coords;
|
||||||
|
|
||||||
|
// if (!isEqual(myPosition, myLastPosition)) {
|
||||||
|
// console.log("debugTreatPosition2===>>")
|
||||||
|
// getPositionInformation(myPosition).then((response) => {
|
||||||
|
// console.log("debugTreatPosition3===>>", response)
|
||||||
|
// if (response.results !== undefined) {
|
||||||
|
// console.log("debugTreatPosition4===>>")
|
||||||
|
// if (response.results.length > 0) {
|
||||||
|
// console.log("debugTreatPosition5===>>")
|
||||||
|
// let most = response.results[0]
|
||||||
|
// let {address_components, formatted_address, place_id} = most
|
||||||
|
// this.setState({address: address_components, textadress: formatted_address, place: place_id})
|
||||||
|
|
||||||
|
// let results = response.results;
|
||||||
|
// let shortcountry;
|
||||||
|
// let mcountry;
|
||||||
|
// for (let i = 0; i < results[0].address_components.length; i++) {
|
||||||
|
// for (let j = 0; j < results[0].address_components[i].types.length; j++) {
|
||||||
|
// console.log("debugTreatPositionX===>>",JSON.stringify(results))
|
||||||
|
// if (results[0].address_components[i].types[j] === "country") {
|
||||||
|
// console.log("debugTreatPosition6===>>")
|
||||||
|
// mcountry = results[0].address_components[i];
|
||||||
|
// shortcountry = mcountry.short_name;
|
||||||
|
// this.setState({shortCountry: mcountry.short_name, longCountry: mcountry.long_name})
|
||||||
|
// } else if (results[0].address_components[i].types[j] === "locality") {
|
||||||
|
// console.log("debugTreatPosition7===>>")
|
||||||
|
// const name = results[0].address_components[i].short_name;
|
||||||
|
// this.setState({townName: name});
|
||||||
|
// getTownInformationName(name).then((result) => {
|
||||||
|
// console.log("debugTreatPosition8===>>",result)
|
||||||
|
// let town = null;
|
||||||
|
// if (result instanceof Array) {
|
||||||
|
// town = result[0];
|
||||||
|
// } else
|
||||||
|
// town = result;
|
||||||
|
// console.log("Mise a jour getTownInformationNametown===>>", town);
|
||||||
|
// this.setState({town: town});
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// console.log("debugTreatPosition10===>>")
|
||||||
|
// getDefaultTown().then(result => {
|
||||||
|
// getTownInformationName(result.default_locality).then((resultTowwn) => {
|
||||||
|
// let town = null;
|
||||||
|
// if (resultTowwn instanceof Array) {
|
||||||
|
// town = resultTowwn[0];
|
||||||
|
// } else
|
||||||
|
// town = resultTowwn;
|
||||||
|
// this.setState({town: town});
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// getListCountriesActive().then((cnt) => {
|
||||||
|
// this.setState({countries: cnt})
|
||||||
|
// console.debug(cnt, shortcountry);
|
||||||
|
// var found = false
|
||||||
|
// for (let i of cnt) {
|
||||||
|
// if (i.code_country === shortcountry) {
|
||||||
|
// found = true
|
||||||
|
// this.setState({indicatif: i.code_dial, country: i.name})
|
||||||
|
// this.getNetworks(i.code_dial);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (!found) {
|
||||||
|
// Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{text: "OK"}]);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }).catch((e) => {
|
||||||
|
|
||||||
|
// });
|
||||||
|
// this.setState({myPosition: myPosition});
|
||||||
|
// if (this.mapRef !== undefined && this.mapRef !== null) {
|
||||||
|
// this.mapRef.animateToCoordinate({
|
||||||
|
// latitude: myPosition.latitude,
|
||||||
|
// longitude: myPosition.longitude
|
||||||
|
// }, 1000);
|
||||||
|
// this.mapRef.animateToRegion({
|
||||||
|
// latitude: myPosition.latitude,
|
||||||
|
// longitude: myPosition.longitude,
|
||||||
|
// latitudeDelta: 0.03,
|
||||||
|
// longitudeDelta: 0.01,
|
||||||
|
// }, 1000)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
treatPosition = async (position) => {
|
||||||
const myPosition = position.coords;
|
const myPosition = position.coords;
|
||||||
|
if (isEqual(myPosition, this.state.myPosition)) return;
|
||||||
if (!isEqual(myPosition, myLastPosition)) {
|
|
||||||
getPositionInformation(myPosition).then((response) => {
|
try {
|
||||||
if (response.results !== undefined) {
|
const { results = [] } = await getPositionInformation(myPosition);
|
||||||
if (response.results.length > 0) {
|
if (!results.length) return;
|
||||||
let most = response.results[0]
|
|
||||||
let {address_components, formatted_address, place_id} = most
|
const comps = results[0].address_components;
|
||||||
this.setState({address: address_components, textadress: formatted_address, place: place_id})
|
const country = comps.find(c => c.types.includes("country"));
|
||||||
|
const locality = comps.find(c => c.types.includes("locality"));
|
||||||
let results = response.results;
|
|
||||||
let shortcountry;
|
if (country) {
|
||||||
let mcountry;
|
this.setState({ shortCountry: country.short_name,
|
||||||
for (let i = 0; i < results[0].address_components.length; i++) {
|
longCountry : country.long_name });
|
||||||
for (let j = 0; j < results[0].address_components[i].types.length; j++) {
|
}
|
||||||
if (results[0].address_components[i].types[j] === "country") {
|
|
||||||
mcountry = results[0].address_components[i];
|
let townName, townInfo;
|
||||||
shortcountry = mcountry.short_name;
|
|
||||||
this.setState({shortCountry: mcountry.short_name, longCountry: mcountry.long_name})
|
if (locality) {
|
||||||
} else if (results[0].address_components[i].types[j] === "locality") {
|
townName = locality.short_name;
|
||||||
const name = results[0].address_components[i].short_name;
|
townInfo = await getTownInformationName(townName);
|
||||||
this.setState({townName: name});
|
} else {
|
||||||
getTownInformationName(name).then((result) => {
|
const def = await getDefaultTown();
|
||||||
let town = null;
|
townName = def.default_locality;
|
||||||
if (result instanceof Array) {
|
townInfo = await getTownInformationName(townName);
|
||||||
town = result[0];
|
}
|
||||||
} else
|
|
||||||
town = result;
|
this.setState({
|
||||||
this.setState({town: town});
|
townName,
|
||||||
})
|
town: Array.isArray(townInfo) ? townInfo[0] : townInfo
|
||||||
} else {
|
});
|
||||||
getDefaultTown().then(result => {
|
|
||||||
getTownInformationName(result.default_locality).then((resultTowwn) => {
|
// autres mises à jour (carte, myPosition, réseaux, …)
|
||||||
let town = null;
|
this.setState({ myPosition });
|
||||||
if (resultTowwn instanceof Array) {
|
this.mapRef?.animateToCoordinate(myPosition, 1000);
|
||||||
town = resultTowwn[0];
|
this.mapRef?.animateToRegion({ ...myPosition,
|
||||||
} else
|
latitudeDelta: 0.03, longitudeDelta: 0.01 }, 1000);
|
||||||
town = resultTowwn;
|
|
||||||
this.setState({town: town});
|
} catch (e) {
|
||||||
});
|
// gestion d'erreur
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
getListCountriesActive().then((cnt) => {
|
|
||||||
this.setState({countries: cnt})
|
|
||||||
console.debug(cnt, shortcountry);
|
|
||||||
var found = false
|
|
||||||
for (let i of cnt) {
|
|
||||||
if (i.code_country === shortcountry) {
|
|
||||||
found = true
|
|
||||||
this.setState({indicatif: i.code_dial, country: i.name})
|
|
||||||
this.getNetworks(i.code_dial);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{text: "OK"}]);
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
this.showErrorDialog()
|
|
||||||
});
|
|
||||||
this.setState({myPosition: myPosition});
|
|
||||||
if (this.mapRef !== undefined && this.mapRef !== null) {
|
|
||||||
this.mapRef.animateToCoordinate({
|
|
||||||
latitude: myPosition.latitude,
|
|
||||||
longitude: myPosition.longitude
|
|
||||||
}, 1000);
|
|
||||||
this.mapRef.animateToRegion({
|
|
||||||
latitude: myPosition.latitude,
|
|
||||||
longitude: myPosition.longitude,
|
|
||||||
latitudeDelta: 0.03,
|
|
||||||
longitudeDelta: 0.01,
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
if (this.watchID) Geolocation.clearWatch(this.watchID);
|
if (this.watchID) Geolocation.clearWatch(this.watchID);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderUserGeoAccount() {
|
renderUserGeoAccount() {
|
||||||
|
const { selectedCountry } = this.state;
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{this.prepareModal()}
|
{/* {this.prepareModal()} */}
|
||||||
<View style={{flexDirection: 'row'}}>
|
<View style={{flexDirection: 'row'}}>
|
||||||
<Icon.Button name={"keyboard-backspace"}
|
<Icon.Button name={"keyboard-backspace"}
|
||||||
color={"white"}
|
color={"white"}
|
||||||
|
@ -556,7 +702,27 @@ export default class CreateUserStep2 extends Component {
|
||||||
paddingRight: 20,
|
paddingRight: 20,
|
||||||
backgroundColor: 'white'
|
backgroundColor: 'white'
|
||||||
}}>
|
}}>
|
||||||
<Dropdown
|
<Fumi
|
||||||
|
iconClass={FontAwesomeIcon}
|
||||||
|
label={I18n.t('COUNTRY_CHOICE')}
|
||||||
|
// value={this.state.countries}
|
||||||
|
value={selectedCountry ? `${selectedCountry.label}` : ''}
|
||||||
|
enabled={false}
|
||||||
|
editable={false}
|
||||||
|
onChangeText={(value, index, data) => {
|
||||||
|
const selectedCountry = this.state.countries[index];
|
||||||
|
this.setState({
|
||||||
|
countries: selectedCountry.countries,
|
||||||
|
indicatif: selectedCountry.code_dial,
|
||||||
|
network: null
|
||||||
|
});
|
||||||
|
this.getNetworks(selectedCountry.code_dial);
|
||||||
|
}}
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
{console.log("town===>>",this.state.town)}
|
||||||
|
{/* <Dropdown
|
||||||
label={I18n.t('COUNTRY_CHOICE')}
|
label={I18n.t('COUNTRY_CHOICE')}
|
||||||
data={this.state.countries}
|
data={this.state.countries}
|
||||||
useNativeDriver={true}
|
useNativeDriver={true}
|
||||||
|
@ -574,7 +740,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
labelExtractor={(value) => {
|
labelExtractor={(value) => {
|
||||||
return value.name
|
return value.name
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
</View>
|
</View>
|
||||||
<Animatable.View ref={(comp) => {
|
<Animatable.View ref={(comp) => {
|
||||||
this.numanim = comp
|
this.numanim = comp
|
||||||
|
@ -767,7 +933,7 @@ export default class CreateUserStep2 extends Component {
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<MaterialDialog
|
<MaterialDialog
|
||||||
title={'Selecionner un reseau'}
|
title={'Selectionner un reseau'}
|
||||||
items={LONG_LIST.map((row, index) => ({value: row, label: row}))}
|
items={LONG_LIST.map((row, index) => ({value: row, label: row}))}
|
||||||
visible={this.state.networksinglePickerVisible}
|
visible={this.state.networksinglePickerVisible}
|
||||||
selectedItem={this.state.singlePickerSelectedItem}
|
selectedItem={this.state.singlePickerSelectedItem}
|
||||||
|
@ -1018,8 +1184,9 @@ export default class CreateUserStep2 extends Component {
|
||||||
data['category'] = user.category;
|
data['category'] = user.category;
|
||||||
|
|
||||||
data['active'] = '0';
|
data['active'] = '0';
|
||||||
|
console.log("data===>>",data);
|
||||||
createGeolocatedAccount(data).then((result) => {
|
createGeolocatedAccount(data).then((result) => {
|
||||||
console.log(result);
|
console.log("result===>>",result);
|
||||||
if (result.success !== undefined && result.success === 1) {
|
if (result.success !== undefined && result.success === 1) {
|
||||||
const message = result.category === 'super' ? I18n.t("HYPERVISOR_MUST_VALIDATE_SUPERVISOR")
|
const message = result.category === 'super' ? I18n.t("HYPERVISOR_MUST_VALIDATE_SUPERVISOR")
|
||||||
: I18n.t("ACCOUNT_SUCCESSFULL_CREATED")
|
: I18n.t("ACCOUNT_SUCCESSFULL_CREATED")
|
||||||
|
|
|
@ -22,9 +22,10 @@ var serializeJSON = function (data) {
|
||||||
|
|
||||||
export const getCodeInformation = (code) => {
|
export const getCodeInformation = (code) => {
|
||||||
var data = {
|
var data = {
|
||||||
"tag": 'member', "type": "agen_info_code", "code": code,
|
"tag": 'member', "type": "agen_info_code", "code": "+237",
|
||||||
"lang": I18n.currentLocale()
|
"lang": I18n.currentLocale()
|
||||||
};
|
};
|
||||||
|
console.log("2===>>");
|
||||||
|
|
||||||
return queryData(data, memberActionUrl)
|
return queryData(data, memberActionUrl)
|
||||||
}
|
}
|
||||||
|
@ -41,8 +42,7 @@ function queryAuth(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queryData(data, url) {
|
async function queryData(data, url) {
|
||||||
console.warn("REQUEST URL", url);
|
console.log("3===>>",url);
|
||||||
console.warn("REQUEST BODY", JSON.stringify(data));
|
|
||||||
data["lang"] = I18n.currentLocale();
|
data["lang"] = I18n.currentLocale();
|
||||||
data["isTest"] = isDebugMode
|
data["isTest"] = isDebugMode
|
||||||
/* await axios({
|
/* await axios({
|
||||||
|
@ -60,7 +60,7 @@ async function queryData(data, url) {
|
||||||
console.warn("SERVER RESPONSE ERROR", error);
|
console.warn("SERVER RESPONSE ERROR", error);
|
||||||
return {"error": "error", "error_msg": error}
|
return {"error": "error", "error_msg": error}
|
||||||
});*/
|
});*/
|
||||||
|
console.log("Ici data===>>", data)
|
||||||
let response = await fetch(url, {
|
let response = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -78,6 +78,7 @@ async function queryData(data, url) {
|
||||||
console.warn("SERVER RESPONSE ERROR", responseText);
|
console.warn("SERVER RESPONSE ERROR", responseText);
|
||||||
return {"error": "error", "error_msg": responseText}
|
return {"error": "error", "error_msg": responseText}
|
||||||
}
|
}
|
||||||
|
console.log("responseJson===>> ", responseJson);
|
||||||
return responseJson;
|
return responseJson;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,11 @@
|
||||||
export const isDebugMode = false
|
export const isDebugMode = false
|
||||||
//base url test
|
|
||||||
//export const baseUrl = "https://ilink-app.com/mobilebackendbeta"
|
|
||||||
//base url production
|
|
||||||
//export const baseUrl = "https://ilink-app.com/mobilebackend";
|
|
||||||
//export const baseUrl = "https://test.ilink-app.com/mobilebackendtest";
|
|
||||||
//export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest";
|
|
||||||
//const baseUrl = "https://ilink-app.com/mobilebackendtest2"
|
|
||||||
|
|
||||||
export const baseUrl = "https://test.ilink-app.com:8080/mobilebackend";
|
export const baseUrl = "https://test.ilink-app.com:8080/mobilebackend";
|
||||||
export const testBaseUrl = "https://test.ilink-app.com";
|
export const testBaseUrl = "https://test.ilink-app.com";
|
||||||
export const testBaseUrlWithPort = "https://test.ilink-app.com:8086";
|
export const testBaseUrlWithPort = "https://test.ilink-app.com:8086";
|
||||||
|
|
||||||
/*export const baseUrl = "https://ilink-app.com/mobilebackend";
|
|
||||||
export const testBaseUrl = "https://ilink-app.com:8080";*/
|
|
||||||
|
|
||||||
/* export const baseUrl = "https://preprod.ilink-app.com:8080/mobilebackend";
|
|
||||||
export const testBaseUrl = "https://preprod.ilink-app.com"; */
|
|
||||||
|
|
||||||
//base url agent test
|
|
||||||
//const baseUrl = "https://ilink-app.com/mobilebackendtest";
|
|
||||||
|
|
||||||
export const adhesionUrl = baseUrl + '/interacted/LoginAction.php';
|
export const adhesionUrl = baseUrl + '/interacted/LoginAction.php';
|
||||||
export const memberActionUrl = baseUrl + '/interacted/MembersAction.php';
|
export const memberActionUrl = baseUrl + '/interacted/MembersAction.php';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import I18n from 'react-native-i18n'
|
||||||
import {readUser} from './AuthApi'
|
import {readUser} from './AuthApi'
|
||||||
import {isDebugMode, MARKER_URL} from "./IlinkConstants";
|
import {isDebugMode, MARKER_URL} from "./IlinkConstants";
|
||||||
|
|
||||||
let GEOCODDING_URL = "https://ilink-app.com:8080/geocode";
|
let GEOCODDING_URL = "https://test.ilink-app.com/geocode";
|
||||||
let API_KEY = "AIzaSyCQY0rwMM9Pn9XWt5F6YLhGoez_bU1IGtc"
|
let API_KEY = "AIzaSyCQY0rwMM9Pn9XWt5F6YLhGoez_bU1IGtc"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue