Camera plugin is not working in phonegap app for ios - ios

I am new to ios development.
I have created an app with phonegap its working fine with android.
But for IOS its not working. I have installed all the plugins.
Right now i am testing the camera plugin.
But its showing the following error.
Error: Can't find variable: Camera ionic.bundle.js:20306
clickPicture#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/app/common/camera-service.js:11:38
_takePicture#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/app/registration/registeration-controller.js:54:44
$parseFunctionCall#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:21044:23
file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:53439:21
$eval#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:23100:28
$apply#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:23199:28
file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:53438:19
eventHandler#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:11713:25
dispatchEvent#[native code]
triggerMouseEvent#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2863:20
tapClick#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2852:20
tapTouchEnd#file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2975:13
there are two config.xml files in my project
one is in root folder and other one is in staging folder
i made entry of camera plugin in both files as well as tried with individuals file.
i have tried with two types of entries in config.xml
first one :
<feature name="Camera">
<param name="ios-package" value="org.apache.cordova.camera" />
</feature>
Second one
<feature name="Camera">
<param name="ios-package" value="CDVCamera" />
</feature>
But its continuously showing the same error.
here is my project file structure.
i am trying to fix it from last two days. But dont know where i am wrong.

After spent a lot of time. I found that the plugin was not updating ionic.bundle.js for that i just run the cordova platform update ios command.
And now its working fine.

Related

Ionic WKWeabView breaks Template on iOS

I was trying to publish my application on Apple Store, but they blocked it since UIWebView was detected. I found no “UIWebView” occurrences in the project, but the application is still being blocked by the Store.
I found on the Internet that I had to install WKWebView using the following command:
$ ionic cordova plugin install cordova-plugin-ionic-webview --save
Then I had to fix the config.xml in the following way:
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
The application starts, but when I do a GET on a page and try to display the response I have the following result: https://imgur.com/a/uaBWZOf
The first card is static, while the others are dynamic: the static card is displayed correctly, while the dynamic ones are displayed only opening the side menu or clicking the filters. No chance to get the dynamic content on the opening of the page.
The code that generates dynamic content is correct since it runs correctly on Android side and on iOS side without WKWebView installed too.
Ionic version: 6.17.1
Cordova version: 7.1.0
Any idea of what could be what could cause the card problem and how to fix it?

How to integrate/use `WKWebView` plugin in PhoneGap application

I have a Phonegap iOS application in which I am using Angular Kendo mobile framework for build UI.
I want to use WKWebView in my application instead of UIWebView.
So what all steps I need to follow to do so?
I tried to integrate it by adding the WKWebView plugin but in my application I see blank page only and in logs errors for loading html pages.
You have to install the plugin like this:
cordova plugin add cordova-plugin-wkwebview
And after that in your config.xml add this:
<plugin name="cordova-plugin-wkwebview" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

cordova (visual studio) ios plugin with custom framework not packaged?

tried things from this thread , did not work for me.
Basically I am writing a custom plugin for ios, using cordova tool (v5.4) for Visula Studio, and I need to reference a framework (with my dynamic libs). Following instructions, everything built ok, but the app aborts on launching.
By looking at the size of ipa file, looks like my libs/framework are not being packaged (if they were, the size would have been significantly larger).
Here is how my plugin.xml looks like
<config-file target="config.xml" parent="/*">
<feature name="myCDVPlugin">
<param name="ios-package" value="myCDVPlugin" />
</feature>
</config-file>
<header-file src="src/ios/myTest.h" />
<source-file src="src/ios/myTest.m" />
<framework src="src/ios/myLibs.framework" custom ="true"/>
<framework src="UIKit.framework" />
<framework src="Foundation.framework" />
BTW, here is the crash log dumped from the device--
Dyld Error Message:
Library not loaded: #rpath/myLibs.framework/myLibs
Referenced from: /private/var/mobile/Containers/Bundle/Application/77A1CF1C-0C2B-4EBC-A2AB-3CF362E0CD9D/com.test.app/test
Reason: image not found
Dyld Version: 353.12
I had a similar error when i tries to embed a custom swift framework to my project.
What worked for me is to go to the project build settings and change the 'Embedded Content Contains Swift Code' to 'YES'.
Hope it works for you.

Does iAd work with Cordova iOS platform?

I'm working with cordova for ios platform.now, want to integrate IAd into my app.i m following this LINK
but, somehow CDViAd plugin is not called.can anyone suggest, where should I made mistake?
I've done this steps:
Added CDViAd.h and CDViAd.m fiel into plugin folder.
Added iAd and adsupport frameworks.
Copied iAd.js into www folder.
Added this code into the config.xml file
<feature name="iAd">
<param name="ios-package" value="CDViAd" />
</feature>
Copied index.html file from the link.
You Weak Linked the iAd Framework as per the README?
I found another step to do here is , in Cordova.plist or PhoneGap.plist , under the Plugins section, add an identical key and value of the plugin.

Phonegap Blackberry build error for cross domain

When i build my application from phonegap. It works in iPhone, iPad, Android but didn't work in blackberry.
I'm calling cross domain API WSDL.
In blackberry it gives error
URL (exmple :- http://google.com)- could not be retrieved because it was not found in config.xml.
Please verify the <access> elements in the WebWorks config. Contact your service provider if the problem persists.
I have to use in config.xml
<access subdomains="true" uri="*" /> OR <access origin="*" />
?
Last time I had this issue it seems all URL's have to be explicit for BB. If your URL is unknown at runtime (For instance, a user entered URL), The only way around it would be
<feature id="blackberry.app" >
<param name="websecurity" value="disable" />

Resources