Start a new topic

isDeviceSupported not calling callbacks

isDeviceSupported not calling callbacks


Thx Amjad for the hint regarding spaces in the path directory!

The cp command should be fine as it already copies all files inside the css directory (css/*) recursively into the new css directory.

Best regards

Andreas

Hi,

i faced the same problem. It turns out the issue was with the followings:

1. Spaces in project path directory;

2. The implementation of CP command.

i moved the css folder to my desktop (any other place so long no spaces in path); changed the line 50 of the Wikitude generator script to "cp -R /Users/dominodiversified/Desktop/css "${DESTINATION_DIRECTORY}"/css" and it worked fine.

Check Copying Files Recursively at http://www.computerhope.com/unix/ucp.htm to have a better understanding.

 

Good luck

I just verified again that with cordova -v == 5.0.5 and our Wikitude PhoneGap example application (master branch), our Wikitude PhoneGap plugins works just fine.

Can you please create a Wikitude PhoneGap example application on your internal hard drive and chech if that's working for you. 

I'm sorry that I can't give you any other instructions 

 

Best regards

Andreas

Your path is /Volumes/Workspace/... - Does the CreateSampleApp.sh script write access to this directory? Can you make sure that write access is given, use sudo or try it on your local disk.

Best regards

Andreas

Best to keep the thread on point :) 

I am calling isDeviceSupported this way

app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported);

>>> which in turn calls the Wikitude plugin


WikitudePlugin.prototype.isDeviceSupported = function(successCallback, errorCallback, requiredFeatures) {

// Check if the current device is capable of running Architect Worlds

cordova.exec(successCallback, errorCallback, "WikitudePlugin", "isDeviceSupported", );

};

 

This looks all good. But I noticed that when entering the native code this condition fails

 

if ( )

 

When debugging using Safari I notice that cordova.callbackFromNative is successfully called. But neither the callback.success or callback.fail is called. Rather the condition which they have commented (in cordova.js line 290)



                /*

                else

                    Note, this case is intentionally not caught.

                    this can happen if isSuccess is true, but callbackStatus is NO_RESULT

                    which is used to remove a callback from the list without calling the callbacks

                    typically keepCallback is false in this case

                */

 

 

and subsequently removed. 

Am I doing something wrong?

 

Running the script in a "clean" path results in another "cp" error. See output bellow

 



Kjartans-MacBook-Pro:wikitude-phonegap-samples-master kjartanjonsson$ ./CreateSampleApp.sh 

*** GENERATING PROJECT ***

Creating a new cordova project with name "Samples" and id "Plugin" at location "/Volumes/Workspace/Workspace/tests/wikitude-phonegap-samples-master/Scripts/com.wikitude.phonegapsamples"

*** PREPARING SAMPLE CONTENT ***

cp: /css/*: No such file or directory

Kjartans-MacBook-Pro:wikitude-phonegap-samples-master kjartanjonsson$ pwd

/Volumes/Workspace/Workspace/tests/wikitude-phonegap-samples-master

 

 

 

 

Hi Kjartan,
It seems that our script which generates a new cordova project and then adds the example app content is failing during asset copying. You could try to run it like sh CreateSampleApp.sh and use paths that don't contain any white spaces.

The Wikitude PhoneGap exmaple application is our smallest cordova example, so you need to get this one working on your machine.

Once the example app could be created and the script was able to copy the files, it starts downloading the WikitudePlugin from GitHub. This download part can take several minutes, depending on your internet connection speed. An appropriate message is shown in Terminal during that time.

 

Best regards

Andreas

More details regarding creation of samples apps.

After unzipping the "wikitude-phonegap-samples-master.zip" file I run



./CreateSampleApp.sh -d mysamples -ios true -android true

*** GENERATING PROJECT ***

Creating a new cordova project.

*** PREPARING SAMPLE CONTENT ***

usage: cp source_file target_file

       cp source_file ... target_directory

 

The script runs for 5 seconds and creates a directory "mysamples" (which I have uploaded to my dropbox). The www directory contains stuff but all other folders are empty.

I assume that it failes creating the sample since the README file indicates that it takes a long time to run the script.

When I first got started with Wikitude (1.5 years ago) I used a sample app to get me up and running. It worked like a charm. I can not find that example any more.

Would it be possible to offer an **extremly** simple cordova app that I could try.

 

Thanks for your respond. Upgrading cordova to 5.0.0 did not resolve the issue. What I did was 


removed the old project

upgraded cordova to 5.0.0 

ran cordova -v before each cordova command (to make sure)

added the license key and reused my testing code


This ended with the same result 

Running app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported);  did not call the callbacks.

And calling loadARchitectWorld complains about old format 

The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "www/res/ARchitect/SimpleCircle", "html",);

I have uploaded the current test to my dropbox.

         https://dl.dropboxusercontent.com/u/5277907/AugmentedRealityProject.zip

What would be great is to have a simple example working and work from there. I have tried getting the samples to work but the script fails without any errors when generating them.

 

Hi Kjartan,
Can you update your cordova installation? I'm currently on 5.0 and the Wikitude PhoneGap example application, which is available on GitHub, works just fine for me concerning the isDeviceSupported callbacks.

Any feedback on that test run is highly appreciated.

Best regards

Andreas

We have an uppcomming game in development where everything worked fine. AR view showed the enviroment without any issues. Now ... for reasons unknown ... the Wikitude plugin does not work any more.

The project loads without any complaints on my iPhone 5s but the wikitude plugin is not initiated correctly.

So I decided to followed the instructions given in http://www.wikitude.com/developer/documentation/phonegap and the same issue appears. isDeviceSupported callback does not callback.

Using Safari console I try to call isDeviceSupported and nothing happens. When trying to load the world I get an error regarding "old format ... has been removed".

>> app.wikitudePlugin.loadARchitectWorld("www/res/ARchitect/SimpleCircle.html");

The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "www/res/ARchitect/SimpleCircle", "html",); (cordova.js, line 947)

 

I am running cordova 4.3.0 and cordova-ios@3.8.0

 

Here is the project as a zip file having a detailed log file "cli-log.txt" on what I did. Any help would be greatfull.

https://dl.dropboxusercontent.com/u/5277907/AugmentedRealityProject.zip 
Login or Signup to post a comment