i have trie a lot of a lot of a lot time to make a very basi application with ionic, i make my routing but i dont understand why nothing work... Can you send me just a little part of your experience to hep me please.
N
Nico
said
over 8 years ago
Hi!
I have problems getting wikitude to work with an Ionic App (see the thread HERE).
Now I generated an bootstrap Ionic app and just added the wikitude plugin, my "world files" in www/ar and some sample code in www/js/app.js
Would be really awesome if someone could look into it to find the problem here.
// ... code that is executed if the device is not supported ...
console.log("device not supported!");
alert("device not supported!");
}, world.requiredFeatures);
},
onARchitectWorldLaunched: function() { // <- REMOVE THIS CODE -> WILL NOT BE CALLED EVER!
console.log("WORLD loaded!");
},
onARchitectWorldFailedLaunching: function(err) { // <- REMOVE THIS CODE -> WILL NOT BE CALLED EVER!
console.log("world NOT loaded!");
console.log("world NOT loaded! err: " + err);
}
};
Your first mistake was the way you invoked the isDeviceSupported function. You didn't passed a function pointer but called the success handler directly. This happened because you were passing the world parameter to the success handler. This changed a function pointer to a function call, so isDeviceSupported was evaluated after you tried to load the world. Trying to load a world without checking the device support status fails. Fixing this issue caused the loadArchitectWorld error handler to fire.
The second mistake was the relative URL to your Architect World. If you would have compared this with the relative paths we use in our Wikitude PhoneGap application, you would have noticed that the path starts with the 'www' folder and not after it.
Another 'mistake' you made: you used code that is not included in the current WikitudePlugin.js file. Please don't blindly copy code from another thread or project into your own without verifying that is still valid. I marked the sections in the snippet above.
Please read carefully over the snippet I attached and understand the changes I made.
Also please don't open two different threads with the same question at once!
Best regards
Andreas
N
Nico
said
over 8 years ago
Hi!
THANKS! I will try it out immediately!
But to my defense... then the official documentation HERE is totally outdated!
All my code came from the documentation and the samples.
And samples are great but they don't replace good and up-to-date documentation.
Anyway... thanks for your help! I will try it out and if there is another more up-to-date documentation, please let me know.
N
Nico
said
over 8 years ago
OK it´s working now!
Just one more question for today:
I obtained a trial license key.
The documentation states:
"To use the Wikitude Cordova Plugin with a certain license key, use the this._sdkKey property defined in WikitudePlugin.js line 12. Please make sure that the license key is set in the appropriate WikitudePlugin.js file since Cordova is duplicating this particular file in both www folder."
I have no WikitudePlugin.js in my project. Should I just add it?
And what is the purpose of that file?
Again, thanks! You made my day! (but the documentation should still be updated ;)
A
Andreas Schacherbauer
said
over 8 years ago
I'm sorry about the broken documentation link. We will fix that asap.
Your project does contain a WikitudePlugin.js, otherwise the Wikitude Plugin would not work at all. Please use eiter Xcode to search for the file in your project, Finder to search on the file system or the find command in Terminal to locate WikitudePlugin.js in your project.
Hint: normally you find it here: *PROJECT_RROT*/platforms/ios/www/plugins/com.wikitude.phonegap.WikitudePlugin/www/WikitudePlugin.js
Best regards
Andreas
A
Andreas Schacherbauer
said
over 7 years ago
Hi, I'm sorry but we don't have any official support/documentation for Ionic so far. Those kind of questions need to be answered from the community.
I am also trying to implement the wikitude plugin with a newly created ionic project but so far things are not really working out. The steps i took to get it going are the following:
create a new ionic project
installed ngCordova
added the iOS and android platform
did a build of them both
installed the Wikitdue Cordova plugin
added my license key to the following file WikitudePlugin.js
added index.js to the main index.html file in the www folder
created in www a folder called views and in there I created another folder called camera
in the camera folder I created a js folder and place the js files (marker.js & fromwebservice.js), this folder also contains the following files: cameraview.html and poidetail.html
In the cameraview.html file I call upon the wikitude architect like so:
Nico