Start a new topic

WikitudePlugin life cycle

WikitudePlugin life cycle


     We are doing wikitude phonegap app for ios. I want to make AR world flexible like close the world and open it again . I am able to open the world and close it but not able to open it again . I really want to do this very flexible this functionality is the core functionality of the app . Please help it as soon as possible. We bought pro wikitude plugin license for both android and ios . Please let me know how to get technical supports ...


thank you

Hi there!

Please have a look at the provided Wiktiude SDK PhoneGap Sample Application and the documentation section on the Wiktude PhoneGap Plugin. it shows you how to open/close various AR-Samples.

Kind regards,

hi andreas,

              I want to explain a bit about a problem . I want to achieve a functionality which requires AR_Camera need to opened when need ,recognize image and draw image after detection  . After that i want it to be closed .


what i achieved is .

1. initiated wikitudeplugin using "var wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");"

2. opened AR_camera 

3. done image detection and drawn the image after detection.

4.Closed the plugin . 

Now i want to open the AR world again.My question is

1.i have to initiate again wikitudeplugin using "var wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");" ?

2. i have same images for detection but i want to draw different images after detection . So i can't use the same code again as it is.

3.After done that i have to close the plugin . 

opening the AR_world needs to be done with flexibility  because It can be done for many times . 

So please suggest me to ahieve this. I have checked samples and documentation . but its not working the way it should work . May be i missing something .


thank you. 




Hi there!

Hope I got you right.
You can reopen the AR-View numerous times.
To inject "dynamic" information to the AR-View use callJavascript as in the PhoneGap Sample app for loading POIs from Application.
You may e.g. store dynamic information in your PhoneGap environment and relaunch same World as in the Sample App + inject the dynamic information e.g. via

app.wikitudePlugin.callJavaScript( "World.loadPoisFromJsonData(" + JSON.stringify( poiData ) +");");

Hope that helps.

Kind regards;


       "You can reopen the AR-View numerous times."  how to do this in a perfect way?.

Say if i want to reopen the AR-View what i have to call ? . 

i have to open the index.html which includes imagerecognition.js are i have to call the index.js which have coding for  wikitudeplugin inization codes like 

"var wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");" then i have to open the AR-view using loadarchietworld("index.html")(index.html which includes imagerecognition.js ).


Can i maitain 2 files like index.html with imagerecognition.js  and custom_index.html with custom_imagerecognition.js  both have AR-view ? . 

i am using only "IR" mode(imageRecognition only). 


thank you

Hi again,

Note that the Wikitude AR view runs on top of your PhoneGap-Context. You therefore only neet to open the first AR-View using

as described in the sample application. Once user presses back the architectview is closed, but you can afterwards still use the same command to reopen.
It is up to you if you want to open another index.html or reuse the existing and inject some parameters using the callJavaScript feature.

Hope this helps.
If you encounter issues please first set-up the sample project locally first to play around with the feature-set.

Kind regards


no its not helping . 

in samples i can see that AR-view is getting loaded from same index.html page. They close plugin from AR-view and reopen the AR-view from same index.html page . 

In my case . I have to start AR-view from index.html page for the first time only . After that i have to open the AR-view from other .html pages  . in this case what i should do ? Right now i am using window.location = "index.html"; to open the AR-view from other html pages  . Its opening AR-view but closewikitudeplugin not working .  Can you suggest me on this issue . if you point me to sample applications pls point exactly which sample that use this functionality . Thank you

Hi again!

For technical reason one can onyl handle one AR view using the PhoneGap plugin (AR view wraps over PhoneGap screen).
I recommend you to define a single AR entry point which opens the AR view and closes it after e.g. something is recognized.

For your scenario:

> App launch ("index.html")
> User opens camera view
> Target is detected
> Camera View closes, user is back in customized "index.html"

In case you want to e.g. show details of recognized target once recognized, you can handle this inside camera view to decrease number of AR/PhoenGap interactions.

Kind regards


I am not able to load the AR_Camera.

onDeviceSupported: function() {
var lat = app.getUrlParameterForKey(url, 'lat');
var lon = app.getUrlParameterForKey(url, 'lon');
alert('latitude : ' + lat + " longitude : " + lon);



Do we have to do some special setting to have the Camera loaded.

I am using

Cordova.js - 3.5

WikitudePlugin.js - latest from the github (

I donot get any error.  My index.html loads properly and the javascript call also gets executed creating the necessary POI's on the page.

However, the background doesnot show any camera.

Any help would be appreciable.

Hi there!

You need to follow the setup guide provided in the Wikitude PhoneGap Plugin Documentation.
It is not sufficient to simply copy paste some files - during plugman installations the whole project is modified to e.g. set camera permissions and link the JS with the native code implementation.

Kind regards,

I have created an app as suggested on the site.

I am able to load the architect world (implies access the html page that is passed as a parameter to loadArchitectWorld();

But that doesnot show the camera. Just to clarify, the Architect World is a world with the camera in the background by default, right?

Please update.  Am stuck up badly and the deadline is fast approaching.

My app works very fine with android 4.1 installed samsung s2.

However, the same app doesnot work with 4.2.4 installed samsung s4, hence the upgrade of the plugins and sdk was carried out but the camera has wiped out even from s2 setup.

Please help.




Even the camera for the sample apps is not working. Just tried it out after check-out of the sample apps project from the git and following the steps defined to run the app.

There seems to be something being either missed out completely or something.

Can't figure out.  Please give some pointers.

Login or Signup to post a comment