Augmented Reality iOS Tutorial: Location Based

Hi,

I am able to make this work for me but I would like to how do I customize the AR display? I would like to add some more data like rating in the AR and not in the alert view. And also would like to add a image for restaurants’ Gas stations etc. can u help??

Thanks
Manash

Hi Manash,

you should just create your own ARAnnotationView subclass and add everything you need.

Hi,
Am getting

“2017-02-28 11:19:19.607981 Places[27382:1771548] [LogMessageLogging] 6.1 Unable to retrieve CarrierName. CTError: domain-2, code-5, errStr:((os/kern) failure)” this error while running on my device
IOS version: 10.2.1 and Xcode 8.2.1
How can i resolve this error ?

Great guide! Really learning a lot here. One question for you, I’m interested in POIs being displayed as videos instead of static overlays. Have any tips of how to go about that or know of any tutorials/articles that may help? Thanks again!

1 Like

@greatarjun Maybe this on stack overflow can help, but i think it’s a bug in iOS.

@naor92 You should have a look at AVPlayerLayer.

Thanks for your Tutorial .
please , I have new idea and I want ask you about it .
how to use OCR with your Tutorial .
i want to display views with translated text based on User’s language would you please providing help for me?

@safaal3abid hi i’m not sure if i understood everything correct but i guess you mean something like Word Lense. For this you must find the text in the preview image and then use a OCR lib.

You can do the first with OpenCV and the second with Tesseract. There are tutorials for OpenCV (License Plate Recognition and others).

Hi,
I was interested in how I can display a picture with AR. I tried to do it, but I did not succeed. How can I add a picture of the place to the AR display ?

Thanks
Daniel
P.S. I apologize my English, this is not my native language )

Hi Perre

Very interesting tutorial and as a beginner I have learnt a lot but whatever I try I cannot get the Google Places to work. I know this is not directly to do with the tutorial but I have a Google account and added Google Places API, completed Credentials selecting iOS and the bundle identifier ‘com.razeware.Places’. I have copied the API Key to app (the name I gave the key is shown in red on Google page). I have added your tutorial code snippet below to final project but I get this error in console :-
"dict ouput = {
“error_message” = “This IP, site or mobile application is not authorized to use this API key. Request received from IP address “My IP Address”, with empty referer”;
“html_attributions” = (
);
results = (
);
status = “REQUEST_DENIED”;
}

Code Snippet added :-
if let dict = placesDict {
print(“dict ouput = (dict)”)
}

@shadow you can create your own ARAnnotationView subclass and add an image view to it.

@macman Not sure about this error but maybe it has to do with the bundle identifier. Try to change it to something different.

Hi Jean-Pierre

Not sure what you mean by changing it to something else, can you or anybody suggest something suitable please.

I’m not sure how google handles this but the bundle identifier com.razeware.Places is already connected to an other API key, so try to change the identifier in Xcode, e.g. com.macman.places and register the new for the places API.

Thank’s for the answer, but what i should to add in my ARAnnotationView subclass, to have the field with Image for POIs. And one more question, how can I download a photo of the site if the data that comes from Google have this kind of look,
photos = (
{
height = 4160;
“html_attributions” = (
“<a href="Google Maps”>Ralph Peters"
);
“photo_reference” = “CoQBdwAAABZT7LYlGHmdep61gMOtwpZsYtVeHRWch0PcUZQOuICYHEWnZhKsSkVdMLx3RBTFIz9ymN10osdlqrPcxhxn-vv3iSsg6YyM18A51e3Sy0–jO2u4kCC05zeMyFp-k7C6ygsDsiOK4Dn3gsu_Bf5D-SZt_SrJqkO0Ys6CwTJ75EPEhDcRLUGnYt2tSODqn_XwxKWGhRMrOG9BojlDHFSoktoup1OsbCpkA”;
width = 3120;
}
for example
Thank you for help

P.S. I apologize my English, this is not my native language )

hello,
how can I upload data on a server in the points of interest and view them only when they are in a certain position?
thank you so much

Hi Jean-Pierre

Thanks for the suggestion but it still has an error although it is slightly different now (see below). Can anybody suggest a solution or maybe make a short tutorial showing how to set the API up.

Load pois
179 bytes
dict ouput = {
“error_message” = “This API project was not found. This API project may have been deleted.”;
“html_attributions” = (
);
results = (
);
status = “REQUEST_DENIED”;
}

Hello Jean-Pierre,

Google Places API allows for the filtering of different types of POI’s (here is the list of them). How would you implement a filter on the POI’s to only return certain annotations such as ‘hospital’ or ‘university’ within this project?

hello, I have uploaded some geopoint on my server and I have added to the mapview them! How can I even see those in augmented reality?

hi, I’ve got error
“error_message” = “This IP, site or mobile application is not authorized to use this API key. Request received from IP address 114...**, with empty referer”;
“html_attributions” = (
);
results = (
);
status = “REQUEST_DENIED”;

how do I fix that? Thank you

Hi,

I am trying to get this to work using Xamarin.ios.
I have a problem when i turn the device to landscape, all POI’s are on the opposite direction.
In portrait mode everything works as it should.

If I send you the code, could some of you guide me to find the problem?

Hi,

great tutorial : I have one question, on my location I have 16 POI, on the mapview I see all of them but with camera view only 2 annotation appears.
Could you explain me how work the positionAnnotationViews with x,y and why 14 POI has x,y not in the viewport even if i move on all direction (north, east, west, south, top, bottom).

thank you