Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Fix typos in readme, fix EventHandlerBase, change ARKitWrapper (use detail event property, remove json decoding ar arkit returns objects) #15

Closed
wants to merge 3 commits into from

Conversation

andyps
Copy link

@andyps andyps commented Sep 5, 2017

No description provided.

@TrevorFSmith
Copy link
Contributor

Hey, we moved the example code and the polyfill over to the webxr-examples repository: https://github.com/mozilla/webxr-examples

@@ -228,10 +234,10 @@ export default class ARKitWrapper extends EventHandlerBase {

*/
_onWatch(data) {
this._rawARData = JSON.parse(data)
this._rawARData = data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the iOS app to pass the data as a JSON string to the Javascript.

On lline 285 of WebController.m I added single quotes around the parameter:
NSString *jsScript = [NSString stringWithFormat:@"%@('%@')", name, jsString];

Without those quotes, Javascript was unable to execute jsScript.

@TrevorFSmith
Copy link
Contributor

Ok, @andyps, I've incorporated your changes into this repo and the webxr-examples repo.

Thanks for the help!

We should talk about whether or not to pass JSON strings or data structures from iOS into Javascript.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants