We've been using childbrowser for a while to open pdfs in our ios app with no problems. Recently we decided to open a webpage that we were opening in safari in childbrowser, so I split the pdf specific code off from the original webpage opening code and tried to get the window to come up. This, of course, did not work. After trying for a while to get it to work I decided to just make a blank phonegap project, put the childbrowser plugin in and get it to go to google (as in the example).
New phonegap 1.3 project, new fresh childbrowser plugin added (in xcode as a yellow folder in the plugin folder), js for childbrowser added to www folder and to index.html, and added google.com; ChildBrowser/ChildBrowser.js; ChildBrowserCommand/ChildBrowserCommand to phonegap.plist. Then I tried the three different ways I know how to try to open a childbrowser page (shouldStartLoadWithRequest in appdelegate, call the childbrowser javascript, or call the method directly using phonegap.exec) and none of them worked.
Is there something different I have to do to make childbrowser work for 1.3? Or am I missing a step to get webpages to work in general?
First off I figured out that you need to both set up appdelegate to sent the proper pages to childbrowser AND you need to use code to submit the url using childbrowser.
Second, www.google.com does not work, www.google.com/ does.
Related
I am using dropbox for distributing my addhoc builds over the air.Till last week it was working all fine.From this week the html page does not open in safari browser in iphone. Instead it is showing following message
One more thing i would like to mention is i have an app called iZip installed on my test device.So open with iZip option pops up for opening it in iZip,but when I do that the html file loads fine.I searched for this issue but didn't found any solution yet.I also found out that since iOS 9 apple has made changes in opening url schemes.So would that be a problem or some more additional things we need to add.I am testing this on iOS8 and iOS9
I just found out a sad news from this url Discontinuing rendering of HTML content
that dropbox has dropped the support of rendering html file content in browser.So have to look for another way to deploy my build over the air.
Update 1
I have found workaround in which HTML page wont be rendered but still your build will get downloaded successfully.So here is what we have to do now
In our html file we have code like this
itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/9pj4sds3r9k4nlmn/testApp.plist
copy whole thing and paste it in web browser,pop up will appear saying "Open this page in App Store"? just say open and after 4-5 second another pop up saying "dl.dropboxusercontent.com would like to instal .app" so click install and build will get installed.
I think the URL your are using in your browser is the URL to download the HTML file ( due to dl.dropbox ... )
You should find an other url that let user display it ( look for share link )
Any ideas here? I am using Google Polymer with Vulcanize in order to comply with Google's Content Security Policy and not use any inline Javascript in my index.html file, but while it appears to work on Android, it is broken when I try to run it in an iOS emulator.
Is there some iOS specific thing with external javascript files that I should know about? Or any ideas as to why this is happening? Any documentation or something would be helpful, I am only slightly familiar with iOS.
Even a way to get some sort of debugging screen working with xcode would be lovely. I'm using the cordova log plugin to try to get my console.logs to do anything, but nothing is showing up, so I'm just inferring that my external javascript isn't loading.
I am developping a mobile application using Cordova. This application allows users to navigate in a kind of a file manager and allows them to download files. I use the plugin "FileTransfer" to download the file on the user's device and then call the InAppBrowser (version 0.5.2) plugin in order to open it.
While it works really great under Android, I can't say the same under iOS (tested under versions 7 and 8).
This is the line of code I use to open the downloaded file:
window.open(entry.toURL(), "_system");
Under Android, it proposes the user which application he wants to launch to open the file or launches automatically the default application based on the file extension. Under iOS, the file is downloaded and then nothing happens. I have found out I could use the integrated viewer of the InAppBrowser plugin when the user is under iOS. I do that in this way:
if (navigator.userAgent.match(/iPhone|iPod|iPad/))
window.open(entry.toURL(), "_blank");
else
window.open(entry.toURL(), "_system");
With these lines of codes, if the user is under iOS, the integrated viewer is launched and displays the file. The problem is for ZIP files or other files that can't be rendered in the viewer. This one says "Load Error".
I think that if "_system" worked, Safari would be launched and would propose the user how he wants to open the file.
Does anybody have an idea of how I can make "_system" worked in iOS? Is this eventually a known problem (I couldn't find anything related to my problem)?
If this can be relevant to my problem, I use Phonegap Build in order to generate the .ipa file.
On iOS when you use _system, it try to open the url you pass with safari.
As iOS have sandbox access limitations, safari can't open the url because it's inside your app sandbox.
You can try this plugin, it provides an "open with" dialog that will show you the apps that support the type of file you want to open if any available.
https://build.phonegap.com/plugins/1076
I'm developing a phonegap/cordova 2.9 iOS App with jQuerymobile which some links need to open a url with InAppBrowser. Also I've integrated Google Admob. Navigation is basic single page template with some different html pages.
When App is loaded, if I don't go to other sections of the app, when press buttons with In-App Browser URLS, In-App Browser opens. But if I go to other sections of the app and go again to index.html, In-App Browser fails and not working.
Different sections of the App are linked with target="_blank". If I link sections without target="_blank", all works correctly, but I need use target="_blank" to go back to index.html and reload XML data.
I'm searching any solution some days ago but I haven't find anything. Only one similar detailed in this post, but without solution:
http://iphonedevsdk.com/forum/iphone-sdk-development/115057-inappbrowser-is-not-opening.html
Another thing I've tried is install Childbrowser Plugin from https://build.phonegap.com/plugins/2 and use it instead of In-App Browser, but I canĀ“t make it work.
Can anybody Help me?. Thank you very much.
You may have moved on from this, but my scenario was that I was using Cordova 2.9.1 with jquery mobile. At certain points in the user experience I also go back to index.html. This worked fine unless I opened InAppBrowser at any point. InAppBrowser worked, but the next time I went back to a refresh of index.html, all plugins including InAppBrowser would not execute.
My fix was to make a change to CDVInAppBrowser.m as follows:
Instead of:
BOOL isPDF = [#"true" isEqualToString :[theWebView stringByEvaluatingJavaScriptFromString:#"document.body==null"]];
if (isPDF) {
[CDVUserAgentUtil setUserAgent:_prevUserAgent lockToken:_userAgentLockToken];
}
[self.navigationDelegate webViewDidFinishLoad:theWebView];
I took out the isPDF logic and just made sure that it always updated to the previous UserAgent. I was left with just..
[CDVUserAgentUtil setUserAgent:_prevUserAgent lockToken:_userAgentLockToken];
[self.navigationDelegate webViewDidFinishLoad:theWebView];
Hope this helps someone who may have been in a similar scenerio of InAppBrowser breaking jquery-mobile or similar frameworks when cordova.js was reloaded again.
Im developing a phonegap application using xcode. For the design I have some jquery mobile icons to display for certain buttons. I want to host this jquery mobile stuff on the app rather than having a http link to it (and thus using more bandwidth etc).
On the simulator this works fine and the icons show up, but when put on the phone they dont, i presume i have to tell xcode to put the image files on the phone explicitly? In a .plist or something.
Anyone have any insight?
Thanks
All the phonegap resource should be put in path www.
I never get the thing you described, but i think the error may occur because of your path of image. You may change the folder of jqm and try again.