Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using a component named "trip" and this component tries to recover some information, like 'rider id', 'tax' and 'distance' between driver and rider.

When Geolocalization function is passing to the component, it doesn't recover all the objects. I think that Cordova Plugin doesn't ok.

JavaScript
Runtime Error Firebase.set failed: First argument contains undefined in property 'deals.xk7ePu6qC8ZrPeJ0jPxZ7K9kBw33.fee'


Race requisition:

JavaScript
makeDeal(driverId, origin, destination, distance, fee, currency, note, paymentMethod, promocode, discount) { let user = this.authService.getUserData(); return this.db.object('deals/' + driverId).set({       passengerId: user.uid,       currency: currency,       origin: origin,       destination: destination,       distance: distance,       fee: fee,       note: note,       paymentMethod: paymentMethod,       status: DEAL_STATUS_PENDING,       createdAt: Date.now(),       promocode: promocode,       discount: discount     }); }


Search the API for the location, id, of the nearby drivers, and calculate the distance:

JavaScript
getDriver(id) { return this.db.object('drivers/' + id); } // get driver position   getDriverPosition(locality, vehicleType, id) { return this.db.object('localities/' + locality + '/' + vehicleType + '/' + id); }    getActiveDriver(locality, vehicleType) { return this.db.list('localities/' + locality + '/' + vehicleType); }


Can anyone help me?

What I have tried:

I tried to increase to "high accuracy" in location settings and I've set the permissions to try to solve this issue.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900