Skip to content

Instantly share code, notes, and snippets.

@yailPeralta
Last active August 11, 2016 19:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yailPeralta/2b968a3f7d3a0c7cf5a7103f7880961f to your computer and use it in GitHub Desktop.
Save yailPeralta/2b968a3f7d3a0c7cf5a7103f7880961f to your computer and use it in GitHub Desktop.
The Wikitude Config function to be incuded in the run method of the main module
/**
* Created by yailanderson on 06/06/16.
*/
'use strict';
(function (angular) {
/**
*
* @param WikiTude
* @param Config
* @param $window
* @param $ionicPlatform
*/
function wikiTudeConfig (Config, $window, $ionicPlatform) {
// the wikitude sdk key included from your config file
var wikitudKey = Config.ENV.WIKITUDE_SDK_KEY;
$ionicPlatform.ready(function () {
if ($window.cordova) {
var wikitudePlugin = $window.cordova.require('com.wikitude.phonegap.WikitudePlugin.WikitudePlugin');
//set the wikitude key
wikitudePlugin._sdkKey = wikitudKey;
$window.plugins.wikitudePlugin = wikitudePlugin;
//console.log('wikitude plugin: ', $window.plugins.wikitudePlugin);
}
});
}
wikiTudeConfig.$inject = ['Config', '$window', '$ionicPlatform'];
// Main module
angular.module('main')
.run(wikiTudeConfig)
})(window.angular);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment