Start a new topic

ios 8.1 and Android S5

ios 8.1 and Android S5


Hello,

 

I have upgraded the wikitude phonegap plugin and suddenly the following isnot working anymore

WikitudePlugin.isDeviceSupported is no longer firing on ios. On android it fires however the errorcallback only!!!

 WikitudePlugin.loadARchitectWorld(wikitudeCallbacks.success, wikitudeCallbacks.error, path); fires on android but not on ios 8.1

Its actually gets fired on android however both the successcallback and the error callbacks get fired.

/* forward locationChanges to custom function */

AR.context.onLocationChanged = function(latitude, longitude, altitude, accuracy){

alert('location Changed');

};

 

no longer is working on android havent tested it on ios becuz couldnt even open it.

 

Any solution please. Becuase i always post but no answer!

 

 

Hi Mohammad,
Please refer to the Wikitude PhoneGap Plugin changelog and the Wikitude PhoneGap example application. isDeviceSupported has changed and does not require additional parameter.

Also note that WikitudePlugin._anyFunctionCall is not the way the current Wikitude PhoneGap Plugin should be used. Please create a new instance of our Plugin by calling app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");

 

To give you a complete overview, here is a snippet from our example application:

onDeviceReady: function() {

        

        // check if the current device is able to launch ARchitect Worlds

        app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");

        app.wikitudePlugin.isDeviceSupported(function() {

                app.isDeviceSupported = true;

            }, function(errorMessage) {

                app.isDeviceSupported = false;    

                alert('Unable to launch ARchitect Worlds on this device: n' + errorMessage);            

            },

           

        );

    }

 


Best regards

Andreas

The issues is still present even with the modified code.

The AR world on android shows but the location is not firing . And The plugin.close() is not actually stopping the GPS from searching for location and killing the battery.

IOS 8.1 not working at all.

Here is the full module js code.

 

define(, function (languagePack, router, $, config, uiHelper, kendo, services, currentContext) {

 

        var module = {

            plugin : null,

            viewModel: kendo.observable({

                _openWorld: function (path) {

                    var isAvailable = false;

 

                    if ('WikitudePlugin' in window)

                        isAvailable = true;

                    else

                        isAvailable = false;

 

                    if (!isAvailable) return;

 

                    module.plugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");

 

                    uiHelper.status("");

 

                    setTimeout(function () {

 

                        var options = { timeout: 8000 };

                        var locationError = function (error) {

                            uiHelper.hideStatus();

                            //error location

                            uiHelper.notify({

                                message: languagePack.I("common.locationError"),

                                button: languagePack.I("common.ok"),

                                header: languagePack.I("common.warning"),

                            });

                        };

 

                        window.navigator.geolocation.getCurrentPosition(function (pos) {

                            /*close world*/

                            module.plugin.setOnUrlInvokeCallback(function (url) {

 

                                switch (url.substring(22)) {

                                    case 'back':

                                        module.plugin.close();

                                        break;

 

                                    case 'home':

                                        module.plugin.close();

                                        uiHelper.goto(router.startup);

                                        break;

 

                                    case 'feedback':

                                        module.plugin.close();

                                        uiHelper.goto(router.feedback);

                                        break;

                                    case 'hideLoadingStatus':

                                        uiHelper.hideStatus();

                                        break;

                                }

                            });

 

                            var wikitudeCallbacks = {

                                success: function () {

                                    console.log("success");

                                    app.uiHelper.hideStatus();

                                },

                                error: function () {

                                    console.log("error loading Ar");

                                    app.uiHelper.hideStatus();

                                }

                            };

 

                            module.plugin.loadARchitectWorld(wikitudeCallbacks.success, wikitudeCallbacks.error, path, );

 

                        }, locationError);

                    });

                },

                showProjects: function () {

                    var projects = kendo.format('www/resources/world/p2/index-{0}.html', currentContext.language);

                    this._openWorld(projects);

                }

            })

        };

        return module;

    });

 

have you set the NSLocationWhenInUseUsageDescription key in your iOS application .plist?
Login or Signup to post a comment