evothings / evothings-studio

Evothings Studio
http://www.evothings.com/
Apache License 2.0
52 stars 33 forks source link

evothings-viewer vs evothings-client and key based joining #95

Open robertoandrade opened 9 years ago

robertoandrade commented 9 years ago

I've checked out the evothings2 branch and tried building it and it failed and I had to work around the build errors to get it to work (issues with not finding evothings-viewer, so I simply symlinked evothings-client as evothings-viewer; and also issues with copying evothings-examples/resources/ui to the final destination where it was already a symlink to the same directory, so it fails).

Once the build was successful and I was able to run it, I noticed it now does things differently than v1 by allowing you to fetch a session key from some server which you're supposed to enter on the client to let you join instead of hardcoding the IP like before (that is great!).

My question is how do I go about doing that on my own Cordova app?

I also couldn't find a new version of the evothings-client to be able to enter such key. When I tried running the one the build process checked out, all I got was an error on the mobile device screen (ERROR: Start page at 'www/index.html' was not found).

Looking forward to trying out the new stuff.

robertoandrade commented 9 years ago

I found the following link on the site that talks about the viewer app, but couldn't find source code for it anywhere?

ghost commented 9 years ago

@robertoandrade

Hi Roberto, we are planning to open-soruce the Viewer app, but it is still a bit early. Sorry for the misleading link, and the build problems this is causing.

To answer your question, you can make your own Cordova app, with the plugins you want to use, and use it with Evothings Studio Alpha 3.

The most simple solution is this:

1) Get a connect key in the Workbench

2) Enter this code in the index.html file in the Cordova app:

<script>window.location.assign('http://staging.evothings.com:8081/connect/CONNECTCODE')</script>

(replace CONNECTCODE with the actual code from the Workbench)

3) Build and run the app, it should connect automatically.

The catch with this method is that the code times out in 5 minutes, so the app must be built and run within 5 minutes.

As an alternative to the above, if it takes longer than 5 min to build, or if you want a UI for the connect code, a text field can be used to enter the code. They you only have to rebuild when updating the native code, and when releasing (replace index.html with the text field with the production version).

Let me know if you want me to make an example of an index.html with a text field and a connect button, and a script. Planning to do this as a tutorial.

Best regards, Mikael

robertoandrade commented 9 years ago

Ok, Followed that, but when I click Run on the Workbench, it refreshes the view on the app with an error reading File Not Found: /<guid>/index.html. Any ideas?

robertoandrade commented 9 years ago

I noticed it created a www/evothings.json in my project with that uuid but every time I Run, it gives me the File Not Found error.

robertoandrade commented 9 years ago

Also the window.location.assign code in Android opens up a separate browser window (ie: Chrome) than the Cordova's webview. Any way around that?

ghost commented 8 years ago

@robertoandrade Hi sorry for slow response. Can you try to connect in a web browser just as a test? Get a connect key in the Workbench, the enter the connect URL in the browser, for example:

http://staging.evothings.com:8081/connect/nsgf7369

The UUID in evothings.json is not used to connect (that ID is sent by the Workbench to the Viewer app to track the current application).

The Evothings Viewer repo is now public: https://github.com/evothings/evothings-viewer