我已将我感兴趣的地方添加到Google地方,并附带我的APP。 Place已成功添加,但地址字段为空。
这是代码:
{
GMSPlacesClient.provideAPIKey(googlePlaceAPIKEY)
let placesClient = GMSPlacesClient.shared()
let userAddedPlace = GMSUserAddedPlace()
userAddedPlace.name = "NightClub & Bar"
userAddedPlace.address = "48 Gandhi Road, Bandra, Mumbai, Maharastra"
userAddedPlace.coordinate = CLLocationCoordinate2DMake(19.017615 , 72.856164)
userAddedPlace.phoneNumber = "9999999999"
userAddedPlace.website = "http://www.google.com/"
userAddedPlace.types = ["bar"]
placesClient.add(userAddedPlace, callback: { (place, error) -> Void in
if let error = error {
print("Add Place error: \(error)")
return
}
if let place = place {
print("Added place with placeID \(place.placeID)")
}
})
}
我可以看到" NightClub& BAR"在我的地方名单,但地址" 48 Gandhi Road,Bandra,Mumbai,Maharastra" 不在那里。
有谁能告诉我我犯了什么错误?