About the Download

Ti.GoogleVR

Ti.GoogleVR is an iOS Hyperloop wrapper of the Google VR SDKTi.GoogleVR provides an easy way develop your own virtual reality experience using what Google best provides.

With Titanium and Hyperloop you can embed this module into your project and with a few lines of code you will be able to create an amazing VR experience into your app.

Some examples of things you can use with this module:

Create a VR Image View

vrviewoculus-street-view

Create a VR Video View

unnamed (1)

README

These instructions are being shipped with the module, so you can check later on your README file.

LoopModules – Ti.GoogleVR

This HyperLoop module allows you to use the Google VR SDK.

1 – Requirements

This project uses HyperLoop. We recommend you to read the basics of HyperLoop in the links below before proceeding any further in this README.
iOS: Hyperloop_for_iOS-Programming_Guide
Android: Hyperloop_for_Android_Programming_Guide

HyperLoop does a pretty good job in allowing you to use Objective-C / Swift with Javascript syntax, but that doesn’t mean that you won’t
need to learn Objective-C / Swift if you want to customise the module / create your own. For that reason we highly recommend you to
learn the basics of Objective-C / Swift.
In the long run that will make your job easier, since Objective-C is far from being an easy language to understand at the first sight.

2 – Check your environment setup

This module was tested and developed with the following environment:

  • CocoaPods 1.0.1
  • Titanium SDK 6.0.1.v20161217061750
  • HyperLoop 2.0.0
  • XCode 8.2.1

3 – Creating a HyperLoop-enabled project:

  • Create a new Alloy project like you would normally do.
  • Copy the “Podfile” provided by us to your project’s root folder. DON’T EXECUTE “pod install” (like you would normally do) after this.
    When building your project HyperLoop will automatically resolve the dependencies of the libs/frameworks you referenced in your Podfile.
  • Take a look at the example tiapp.xml file that you’ve received from us. Your tiapp.xml should have the same properties defined in this example
    otherwise you’ll face some issues while building your project later on.
    Don’t forget to change the App GUID in the provided tiapp.xml file to your original App GUID!
  • Copy the “appc.js” file to your project’s root folder.
  • Copy the controller, styles and view files  + the “libs” folder provided with this module to your project’s “/app” folder.
  • Create a folder named “src” in your project’s root folder. We’ll have to copy a few files to this folder to make sure the module works.
  • Build and run your project for the first time. After all the CocoaPods dependencies are resolved CANCEL the build and open the folder “/Pods/GVRSDK/Resources”.
    This folder can be found inside your project’s root folder. Copy all the “.bundle” files from this folder to your previously created “src” folder.
    Doing so will guarantee that the module works properly, since the Google VR SDK depends on these bundles to work. As of now HyperLoop doesn’t copy these files
    automatically to the App. There’s already a JIRA ticket for this issue: https://jira.appcelerator.org/browse/AC-4353.

4 – Usage

After creating a Hyperloop-enabled project you can start playing with the files you’ve received.
In the code of this controller we’ve covered the main features of the Google VR SDK, but you can always refer to the original source code and check
the methods/properties that we didn’t use in this example.
After following all the steps above you should have the project up and running without any problems.

Displaying images

Copy all of your 360 images to the “src” folder inside your project.
You can find a 360 example image in the “assets” folder named ‘office.png’.
You can reference these files in your code with the following:

var UIImage = require('UIKit/UIImage');
UIImage.imageNamed(<Name of your image>);

Displaying videos

Displaying 360 videos with this module can be done in two ways:

  • Copying your videos to the “src” folder.
  • Using a video from the internet.

In both ways, you can do that by using:

var NSURL = require('Foundation/NSURL');
NSURL.URLWithString("<location of your video>");

Support

One of the things we want to offer you as a reward for joining LoopModules is the ability to contact us to discuss and get help with problems that you may come across.
We’ve tested this module a lot of times and we want to deliver something that will work for everyone (as long as the environments are the same, e.g. SDK, HL version, and so on).
If you come across one of the following:

  • Bugs
  • Suggestions
  • Issues while compiling this module

Feel free to contact us at contact@loopmodules.com.

Demo running with Hyperloop

Aug-15-2016 17-57-02