Setup Guide Titanium Module iOS
The Augmented Reality View
From a technical point of view the SDK adds a UI component called AR View, similar to a web view. In contrast to a standard web view the AR View can render augmented reality content.
Content developed for the AR View is written in JavaScript and HTML. It is important to understand that the .html
and .js
files for the AR view are different from the Titanium JavaScript files.
How to Setup the Module
To use the Wikitude Module in a Titanium project download and install the module from Wikitude download page
For more information please visit the documentation from Appcelerator on how to use Titanium modules. After the module was added to the project, make sure that the module is also listed in the project's module configuration.
Wikitude Sample App Getting Started quickly
Wikitude offers an fully-configured example application as Titanium app hosted on GitHub. The application demonstrates the usage of the Wikitude Titanium Module as well as the usage of the ARchitectWindow
. Furthermore the application includes several ARchitect World examples which are described in more detail in the Example section of this documentation.
Building the Wikitude Sample App for Titanium
- Download or clone the Titanium Sample App from GitHub and extract the zip file
Create new Workspace
Select "Import Project" in the new empty workspace created in step 2
From all the options select
Existing Mobile Project
Point it to the directory
WikitudeTitaniumSample
found in the location where you unpacked the zip file from step 1The warning you will receive is expected as the Application GUID will be generated upon launching your application.
Download and extract the latest Wikitude Titanium module
copy the
modules
folder to the root directory of your projectClick Run for the platform of your choice
Note: Although the Wikitude SDK is also JavaScript based you cannot call Wikitude function in your Titanium environment or vice versa.
JavaScript Interface
To create and launch an ARchitect World, we provide a file called ARchitectWindow.js
. Please have a look at the SampleApplication how the ARchitectWindow
is used.
You can interact between Titanium and ARchitect JavaScripts using
AR.platform.sendJSONObject({foo:"bar"})"
and customize the onJSONObjectReceived
method in the ARchitectWindow.js
. That way you can pass arguments e.g. as JSON string from Wikitude's ARchitectWindow
into your Titanium project to handle custom events.
We recommend to separate the JavaScript files of your AR experience and the rest of your application. By doing so it is easier to handle any logic necessary for the augmented reality interface in the Wikitude's JavaScript and logic related to the general user interface in the JavaScript parts of Titanium.
You can load Augmented Reality experiences developed with the Wikitude SDK from the application's asset folder or from any web url (compare SampleApplication and the Launch World via Url
option).
Note the following known issues:
- Passing arguments is only possible when the file is located on a remote server. A call like
http://yourdomain/yourfile.html?yourparam=foo
will not work when loaded from assets folder - If you have local
.js
files which should be copied into the bundle, please rename them to a different extension for example.jsl
and also change all references inside your html files to.jsl
. Otherwise Titanium will not include them in the final bundle. (see the article in Appcelerator's forum for more details)
Trial and commercial license
By default the Wikitude SDK comes with no valid license key. Read this chapter on how to obtain a free trial key.