Start a new topic

wikitude crodova plugin

wikitude crodova plugin


/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var app = {



// Url/Path to the augmented reality experience you would like to load
arExperienceUrl: "www/experience/index.html",
// The features your augmented reality experience requires, only define the ones you really need
requiredFeatures: ,
// Represents the device capability of launching augmented reality experiences with specific features
isDeviceSupported: false,
// Additional startup settings, for now the only setting available is camera_position (back|front)
startupConfiguration:
{
"camera_position": "back"
},
// Application Constructor
initialize: function() {

app.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady() , false);
},
// deviceready Event Handler
onDeviceReady: function() {
app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported(), app.onDeviceNotSupported(), app.requiredFeatures);
},
// Callback if the device supports all required features
onDeviceSupported: function() {
app.wikitudePlugin.loadARchitectWorld(app.onARExperienceLoadedSuccessful(),app.onARExperienceLoadError(),app.arExperienceUrl(),
app.requiredFeatures,
app.startupConfiguration
);
},
// Callback if the device does not support all required features
onDeviceNotSupported: function(errorMessage) {
alert(errorMessage);
},
// Callback if your AR experience loaded successful
onARExperienceLoadedSuccessful: function(loadedURL) {

/* Respond to successful augmented reality experience loading if you need to */
},
// Callback if your AR experience did not load successful
onARExperienceLoadError: function(errorMessage) {
alert('Loading AR web view failed: ' + errorMessage);
}

};
app.initialize();

get alert but after alert error is loading ar web view failed.
how to fix it?

 

Hi i made a ngCordova wrapper for the cordova plugin you can download it from here https://gist.github.com/yailPeralta/d86126fe96a0a43f441e11a1cb3bb80e regards.

Hi ketul,
As far as I understood, you get the alert message that is triggered from the onDeviceNotSupported() callback but then you try to load an Architect World which fails? That's expected. If the device does not support the required features, how can it load the Architect World properly?

Which hardware are you using and which OS is it running?

Best regards,

Andreas
Login or Signup to post a comment