Does iAd work with Cordova iOS platform? - ios

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.

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 do I properly add settings to an iOS app with a Cordova project?

In a Cordova build I am trying to add settings for my iOS application. I have the settings already defined in a Settings.bundle/Root.plist file. All I want is the Settings.bundle copied over to the XCode project along with its children.
I'm trying to do this with a resource-file statement:
<platform name="ios">
<resource-file src="res/ios/Settings.bundle" />
...
</platform>
When I do my build, the folder is added 3 times to my project instead of only one time, and none of the files inside that folder is copied over. I see in the log output that there are 3 CpResource statements executed for this resource.
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
This is consistent with what I'm seeing in the resulting XCode project: The folder is there 3 times, but it has no contents. I played around with the location of the Settings.bundle and the number of file inside to see whether there is a relation to the number of times this is executed, but to no avail.
So, my question is, how do I properly add settings to an iOS app with Cordova?
Or, if I stay on this level of analysis: How do I properly copy folder structures into an iOS project?
I didn't find why resource-file added the Settings.bundle three times. But I figured out another way to integrate it into the app: I had to declare an own cordova plug-in that listed this Settings.bundle.
David Souther wrote a detailed instruction here: Cordova Phonegap IOS App Settings.Bundle Possible?
To install me.apla.cordova.app-preferences I had to also include this line into my cordova.xml
<plugin name="cordova-plugin-app-preferences" spec="https://github.com/apla/me.apla.cordova.app-preferences" />

How can I get Cordova to embed a custom iOS framework automatically via a plugin?

According to this bug report, custom iOS Frameworks are added automatically to Xcode's 'Embed Binaries' section.
The 'offending' code linked to from that bug report (the code I actually need) is also present in the version of Cordova I'm using (version 6.0.0, via Meteor), but the framework is still added is a non-embedded binary, making my app fail on startup.
So I'm wondering how I can ensure my custom frameworks get embedded?
The code in question looks like this (in my plugin.xml):
<platform name="ios">
<framework src="build/MyFramework.framework" custom="true" />
</platform>
Try to use the new 'embed' option that is mentioned in the jira ticket to see if they are available in your cordova version.
<platform name="ios">
<framework src="build/MyFramework.framework" custom="true" embed="true"/>
</platform>
Maybe the default value for embed is false.

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.

Camera plugin is not working in phonegap app for 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.

Resources