navigator.app undefined - ios

I'm trying to use:
navigator.app.loadUrl("http://www.google.com", { openExternal:true } );
And it does not work for iOS, either on device and simulator. I've used this same line of code in a similar project, and I'm using the same version of phonegap on both (1.5.0). On android the same code works perfectly. The device ready function also fires, so I'm guessing phonegap is being loaded. I'm not using the phonegap.js file of android, I've checked that.
While debugging I found that navigator.app is an undefined object. Does anybody have any idea of a configuration I might be missing to cause this?
Thanks for your help.
Cheers,
Miguel

The "navigator.app" object is only available on Android. Luckily in the soon to be released 2.3.0 version of PhoneGap you will be able to do:
window.open("http://www.google.com", "_system");
to do exactly what you want to do.

Related

Can I have titanium leave out code block?

Is it possible to have the titanium build command leave out certain parts of code?
We have a demo version app, and I would like to be able to leave this part out when building for the AppStore so I do not have to take it out by hand.
Does anyone know of a way to do this ?
Thanx for your help.
Chris
Is this code you want to have only on Android or is it just code in general that you want to leave out?
When the Appcelerator CLI builds the code it will automatically discard code that does not actually get run by any other code, for example if you have a function like the function below or even just a variable that never gets used when you compile you will see that that code is not even in the final compiled code. This is what I have learned from checking the build for Android and I believe it would be the same for iOS
function neverUsed(){
var neverUsedVar = "blank";
}

Reference to xml_****_**** is ambiguous

I have updated my Xcode to the latest version of 8.0
After the update, I am facing a new build error preventing me to run the project on the simulator.
The error is the below in DDXMLNode.m:
reference to 'XML_DOCUMENT_NODE' is ambiguous
I am using the XMPP framework as pods (pod 'XMPPFramework') so I still can't figure out a way to solve this.
Note that the project is working normally on the device and was working on both Device and Simulator with the previous Xcode Version.
I have tried to search the internet but I still didn't find any solution for this.
I tried to clean the project and delete everything in the DerivedData folder as well, but it didn't solve the issue.
Appreciate any help.
Actually I am posting this answer in case it may help someone in the future.
After searching a lot without finding any answer, I discovered the following:
There is a file called module.modulemap that contains 2 methods.
module libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
module libxmlSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
The first one is used for real devices, the other one for the simulator.
However, when building the app on the simulator, and for a reason that I didnt figure it out, tree.h is being duplicated and causing all these issue.
So what I made to be able to run the project on the simulator was to comment the first method so the app can build successfully.
NB: Don't forget to uncomment the method once you want to run the project again on the real device.
Hope this will help anyone who will face the same issue.
i have tried some way.
I search the word XML_DOCUMENT_NODE with a result here:
then replace every error with the left symbol. It turns out to be OK for me now.

glGenVertexArrays and glDeleteVertexArrays not resolved for Windows

I am trying to port iOS projects to Windows 10 using Windows Bridge for iOS.
But I am stuck to the unresolved functions of glGenVertexArrays, glBindVertexArray, and glDeleteVertexArrays.
The original iOS project is a Cocos2d 2.x project. I am not familiar with OpenGL, Therefore I ask for help here! Thank you!
By the way, I noticed that the same issue also exists if I paste these functions into the sample project of WOCCatalog.
Thank you in advance!
Searching the repo for "glGenVertexArrays" does not return anything. Therefore, this API (along with tons of others) is not yet implemented.

DDMathParser & iOS7/XCode Compatibility

I added DDMathParser as a submodule in my Git repository, and after running it, the code only seems to work with OS X. Right away it gives me the following error in DemoController.h, etc.:
'Cocoa/Cocoa.h' file not found
Can DDMathParser work with a mobile device using iOS7? If so, it isn't clear to me how to accomplish this. My google search online suggests that Cocoa is not possible with iOS. I was able to get it working with Mac OS X - how can I do the same for iOS with my app?
DDMathParser author here. You've copied over more than you need. As the name implies, DemoController is part of a demo showing how the parser works. You shouldn't be including it in your app.
It definitely works with iOS 7. I copied it into my Xcode project folder and it parses like a champ. Can you try that first, then work on Git?

How turn off autofocus with CameraBridgeViewBase opencv4android

I'm developing an app for Android 4.2.2, and I want to turn off the autofocus. There is a way to do it if I'm using CameraBridgeViewBase?
The version of the opencv library is 2.4.5. The specific device in which that I want the app to work fine is Samsung Galaxy s3.
actually i can't present a working solution. But Moster posted a realy good solution for focus and flash here.
He created a class inherited from JavaCameraView and overload some initialization methods! I guess you just need to add a functionality for turning it off. Or you just fix it with type 3 (Camera.Parameters.FOCUS_MODE_FIXED).

Resources