I'm trying to save a
CLLocationCoordinate2D
array into Firestore, but I'm getting error:
'FIRInvalidArgumentException', reason: 'Unsupported type: NSConcreteValue'
And I don't really know how I can perform this.
In the top of the code I've this:
var locations: [CLLocationCoordinate2D] = []
And down in the 'save' button. I've this code:
//Document Reference properties
var _: DocumentReference = self.db
//Collection into Subcollection & Documents
.collection("rastad").document(authentication!)
.collection("promenad").addDocument(data:
//Insert first values
["Dog": txtfield_dog.text!,
"Person": txtfield_person.text!,
"What": txtfield_what.text!,
"Date": txtfield_Datum.text!,
"Time": txtfield_Time.text!,
"Timer": txtfield_timer.text!,
"Kilometers": txtfield_km.text!,
"Locations": locations
], completion: { (err) in
if err != nil
{
print("Error adding info-details")
return
}
else
{
print("Succeded!")
}
So, how can I solve this issue? How can I insert the CLLocationCoordinate2D array into Firestore? And also, how can I later on retrieve it? I would really appreciate any help! Thanks!
EDIT: Maybe this error is clear for you, but well. It's not clear for me and thats the reason why I'm asking the question of course. If I'd know the answer I would not answer this question. And instead of disliking and leave the thread, you can at least leave a comment and tell me the reason for the dislike. So, I guess my question will stand.