Commit f959e7bc authored by Trisno's avatar Trisno
parents fd30eff1 189f580d
......@@ -26,11 +26,14 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "id.web.ravintola.excelsocrm",
"buildNumber": "2006151800"
"buildNumber": "2006161400",
"config": {
"googleMapsApiKey": "AIzaSyCvIFNvXKmBNetqPrV4VnjvF772avYbA3M"
}
},
"android": {
"package": "id.web.ravintola.excelsocrm",
"versionCode": 2006151800,
"versionCode": 2006161400,
"config": {
"googleMaps": {
"apiKey": "AIzaSyAcCfuNHVFstDUE-ZDafWsiUmA3ON79cqo"
......
......@@ -39,15 +39,18 @@ class Login extends React.Component {
}
_getDeviceInfo = async () => {
let { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
if (status !== 'granted') {
// Alert.alert('Akses tidak dizinkan!')
Toast.show("Failed to get push token for push notification!", ToastAndroid.SHORT)
} else if (Device.osName == 'Android' && !Device.isDevice) {
// Alert.alert('Silahkan anda coba di real Device')
Toast.show("Silahkan anda coba di real Device", ToastAndroid.SHORT)
d } else {
if (Constants.isDevice) {
const { status: existingStatus } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
finalStatus = status;
}
if (finalStatus !== 'granted') {
Toast.show('Failed to get push token for push notification!');
return;
}
let fb_token = await Notifications.getExpoPushTokenAsync();
let device_id = Constants.deviceId
let os_name = Device.osName
......@@ -63,7 +66,8 @@ d } else {
}
// console.log(deviceInfoProps);
this.props.setDeviceInfo(deviceInfoProps)
} else {
Toast.show('Must use physical device for Push Notifications');
}
}
......
......@@ -38,24 +38,24 @@ class Outlets extends React.Component {
componentDidMount() {
this._getOutletClosest()
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
})
this._getOutletClosest()
this.OrderedList()
this._getPermissions()
});
// this._unsubscribe = this.props.navigation.addListener('focus', () => {
// this.setState({
// indicator: true,
// })
// // this._getOutletClosest()
// this.OrderedList()
// this._getPermissions()
// });
}
componentWillUnmount() {
this._unsubscribe()
}
// componentWillUnmount() {
// this._unsubscribe()
// }
_getPermissions = async () => {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
......@@ -173,31 +173,31 @@ class Outlets extends React.Component {
})
}
_getOutletClosest() {
let params = {
session_id: this.props.session_id,
lat: this.props.lat,
long: this.props.long
}
// console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest', params).then(res => {
let outletName = res.data.data.outlet_name
this.setState({
// indicator: false,
data_name: outletName
})
// console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
// console.log("INI DATANYA NAME : " + outletName)
}).catch(error => {
const { navigation } = this.props
let response = error.response.data
session(response, navigation)
Alert.alert(response.msg);
})
}
// _getOutletClosest() {
// let params = {
// session_id: this.props.session_id,
// lat: this.props.lat,
// long: this.props.long
// }
// // console.log(params);
// Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest', params).then(res => {
// let outletName = res.data.data.outlet_name
// this.setState({
// // indicator: false,
// data_name: outletName
// })
// // console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
// // console.log("INI DATANYA NAME : " + outletName)
// }).catch(error => {
// const { navigation } = this.props
// let response = error.response.data
// session(response, navigation)
// Alert.alert(response.msg);
// })
// }
toRad(value) {
return value * Math.PI / 180;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment