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