Start a new topic

iOS8 Cannot close AR World

iOS8 Cannot close AR World


Hi @all,
There is a Knowledge Base Article which describes the communication between PhoneGap and the Wikitude Plugin in every detail. Have you had a look at it?

Best regards

Andreas

Hi Brandan,

Did the details posted by Shoguniphicus solve the issue for you?

Greetings

Nicola

Didn't realize many folks still encounter this issue after 1 year I faced the same!

I forgot exactly what was the real problem when we resolved it after the version upgrade because we wanted the app to function properly on iOS 8.
But checking against my code now, it seems like this:

function closeWikitudePlugin()

{

          document.location = 'architectsdk://actionButton?action=close';

/*     document.location = 'architectsdk://action=closeWikitudePlugin'; */

}

 

So I guess the documentation has been updated when I last check last year, so you may need to check again just to be sure.

Hope this helps.

 

Haven't been called by client about the app not working properly for a year now, so I guess it is still working fine.

Hi Andreas,

We are about to buy the license for a new iOS/Android app, but this bug exists for us on iOS8 and is also holding us back from going live. It is working fine in iOS7 but the issue arises in iOS8. With iOS9 around the corner it may well exist there too.

There seems to be a lot of cases where this issue is happening, and not just on a single app. 

Brendan

Have you finde the solution=

Hi, I have the same problem but only in ios 8 and newer version. Some help?? In ios 7 run greatly.

Hi Andreas.

I hava same problem. first call above function from js file.

function closeWikitudePlugin(){
document.location = 'architectsdk://action=closeWikitudePlugin';
if (event) event.preventDefault();
}

second code:

onURLInvoked: function(url){
if ( 'closeWikitudePlugin' == url.substring(22) ) {
app.wikitudePlugin.close();
history.back();
}
},

 

this codes are good for Android. but on iOS it does not work.

please help me.

You can send your project to ios-sdk@wikitude.com. Please also provide some information how to use the App and how to reproduce your problem.

Best regards

Andreas

Hi,

I did update all of the files from .h .m .a, plugin.xml and also the .js file.

However, it didn't work. Is there any update to the javascript portion where I would call this:
In the AR world index.html

document.location = 'architectsdk://action=closeWikitudePlugin';



And else where I would do this.
 

var app = {
// Application Constructor
initialize: function() {
this.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
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');

try{
StatusBar.overlaysWebView(true);
}catch(err){
console.log(err);
}

try{
console.log(module);
}catch(err){
console.log("No module", err);
}

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

// check if the current device is able to launch augmented reality experiences
app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported);
},
// Update DOM on a Received Event
receivedEvent: function(id) {
console.log('Received Event: ' + id);
},
onDeviceSupported: function() {

// setting callback functions that are called when the ARchitect World finished launching or failed.
app.wikitudePlugin._onARchitectWorldLaunchedCallback = app.onARchitectWorldLaunched;
app.wikitudePlugin._onARchitectWorldFailedLaunchingCallback = app.onARchitectWorldFailedLaunching;

app.wikitudePlugin.setOnUrlInvokeCallback(app.onURLInvoked);

// load an ARchitect World
//app.wikitudePlugin.loadARchitectWorld("www/res/ARchitect/5_BrowsingPois_6_CaptureScreenBonus/index.html"); // load an ARchitect World from the application bundle
},
onDeviceNotSupported: function() {
alert("Device Not supported");
// ... code that is executed if the device is not supported ...
},
onARchitectWorldLaunched: function() {

// ... do something when the ARchitect World finished loading
},
onARchitectWorldFailedLaunching: function() {
// ... react on failures. That could be happen when the local path is wrong or the remote url returned an error code
},onURLInvoked: function(url) {
console.log("Recieved", url);
if ( 'closeWikitudePlugin' == url.substring(22) ) {
app.wikitudePlugin.close();
} else {
alert('ARchitect => PhoneGap ' + url);
}
}
};



Please correct me if I am doing this wrong. As for the ultimatum, can I send the source to an email somewhere? As this is a work for a client of mine, so I wouldn't want the source code to be on the forum.

Thanks.

Hi,
I just did a quick check with the current master on GitHub and everythink was working as expected. I assume that you have your own application and maybe forgot to update the Wikitude Plugin completely. Besided the .h/.m/.a files you also need to update the WikitudePlugin.js file in your project.

Can you make sure that you have updated the Plugin correctly?

If you can't get it working, pls. send me your project (It must compile and run without any adoptions) so that I can have a look at it.

Best regards

Andreas

Hi,

Before upgrading the wikitude to 4.0.2, I am able to close the AR world with:

document.location = 'architectsdk://action=closeWikitudePlugin';

However, right now, I am not able to do that, it seems like:

onURLInvoked: function(url) {

    console.log("Recieved", url);

        if ( 'closeWikitudePlugin' == url.substring(22) ) {

            app.wikitudePlugin.close();

        } else {

            alert('ARchitect => PhoneGap ' + url);

        }

    }

 

is not called at all when we try to close the AR world.

This is happening on my iPhone 6+

 

Please assist.
Login or Signup to post a comment