Urban Airship integration with Cordova iOS throwing - ios

I've got an AngularJS web app wrapped into Cordova (iOS platform). Having added the Urban Airship plugin (urbanairship-cordova), I receive the following error when running:
$ npm-exec cordova run ios --device
ERROR running one or more of the platforms: Error: Cannot find module '../ConfigParser/ConfigParser'
You may not have the required environment or OS to run this project
The version requirements for the UA plugin are Cordova 5.0.0+ and Cordova iOS 3.8.0+. I'm running Cordova 5.4.0 (latest at time of writing), any previous 5.x.x versions produce a separate issue in the Angular app with some image assets not appearing.
But the above ConfigParser error only appears in 5.4.0.
If I revert the UA plugin installation, the error goes away. And I get the same error when trying to emulate with iOS simulator.
I've contacted Urban Airship (Twitter) as the Github repo has issues turned off, though their support page (http://goo.gl/ZGrbbi) says I should log issues there.
Any ideas on how to resolve?

There appears to be an incompatibility with the latest version of Cordova and the UA plugin.
For now you can roll back your global version of Cordova to version 5.3.3 with npm;
npm install -g cordova#5.3.3
It'd be worth contacting Urban Airship to explain your problem via email at support#urbanairship.com as advised on the GitHub repo https://github.com/urbanairship/phonegap-ua-push

Looks like the config parser script moved in 5.4.0. Will be fixed in the next release.
Update: We just released 4.0.0 version of the UA plugin. Should be compatible with the latest cordova versions.

Related

IONIC 5 - InAppBrowser is not installed or you are running on a browser -XCODE 13

I have an IONIC 5 / cordova project and I use InAppBrowser to open a link.
In the next code:
const browser = this.iab.create(url);
I get error "WARN: InAppBrowser is not installed or you are running on a browser. Falling back to window.open" on execution time in IOS device and IOS emulator.
I have tried all kinds of things that I have found on the internet:
First, I have done many test with #ionic-native/in-app-browser plugin, but I always get the same result:
Remove node_modules, www, platform/ios
Re-install(remove and install) in-app-browser libraries
Recompile in dev and prod mode.
Same error..
I have tried it again with the new plugin:
$ ionic cordova plugin add cordova-plugin-inappbrowser
$ npm install #awesome-cordova-plugins/in-app-browser
I change the code to get the new native plugin
$ ionic cordova platform add ios
BUILD DEVEL and PROD
$ ionic cordova build ios
$ ionic cordova build ios --prod
Same result.
I have verified that the cordova plugins are installed in the /Plugins folder of the XCode project.
I have a couple of things to comment on:
Now I use XCode 13, but In XCode 12 works fine. To upgrade the XCode I have upgrade MacOS from Catalina To Monterey.
The only difference between the two projects is that in XCode 13 "Legacy build system" is disabled since it's "deprecated".
I don't know if XCode doesn't import the libraries, I don't know if "Legacy Build System" is necessary. I know nothing... :-(
Can anybody help me?
Thanks.
I found the problem.
In my project I have an "Object.prototype" function that it produce a big problem to loop objects.
Referring InAppBrowser pluguin, in file inappbrowser.js:
callbacks = callbacks || {};
for (var callbackName in callbacks) {
iab.addEventListener(callbackName, callbacks[callbackName]);
}
Perhaps it could be improved with an Object.keys(callbacks), but I think that It was my problem.
Thanks.

Ionic "Seems to be a very old project file format - please open your project file in a more recent version of Xcode"

fastlane finished with errors relating to automatic_code_signing. I’m not sure what this means and how to fix it, but it’s an error I hadn’t gotten before. I’m on Ionic v3
This has to do with the iOS platform not being up to date.
iOS builds including cordova-ios v4.5.5 or earlier will fail with this error in Appflow. This issue was corrected in cordova-ios v5.0.0. Updating to a current cordova-ios release will resolve the problem.
To remove and reinstall the iOS platform:
ionic cordova platform rm ios
ionic cordova platform add ios#5.1.1 //the latest release of the current major version is recommended.
This
example specifies the latest version at the time of writing
Source here

Determining cause of cordova iOS build failure

My cordova phone application is building and running well in android, and now I'd like to build for ios. I can't do this in my linux environment, so I'm using a mini-mac with the Xcode tools installed.
I cloned the git repo to a working tree, and I'm running
cordova build ios
In the build output, I'm getting the following, with "fatal error", "BUILD FAILED" and "Error: ..." in red.
/Users/mgfrobozz/Desktop/asap_cordova/platforms/ios/ASAP Media/Plugins/org.apache.cordova.dialogs/CDVNotification.m:21:9: fatal error:
'Cordova/NSDictionary+Extensions.h' file not found
I found https://issues.apache.org/jira/browse/CB-8659, which indicated this issue (deprecated dependency in ios) was resolved in cordova 4.0.0, but I'm running cordova 6.0.0.
I don't know enough about the cordova guts to know how to fix CDVNotification.
Any suggestions?
Try the command: cordova platform update ios

Deployement Error for iOS in VS Cordova

VS version - 2015 with Cordova update 3Mac OS - 10.10.4iOS - 9.0 When building in release mode for iOS we get following warnings. But release folder is created with ipa and plist.
So when uploading that ipa using application loader it gives following 2 errors.
As I mentioned in this stackoverflow thread:
There appears to be an issue with Cordova's iOS implementation when publishing apps created specifically using Xcode 7.
A Cordova community member has published a "cordova-plugin-ipad-multitasking" plugin with a fix.
http://npmjs.com/package/cordova-plugin-ipad-multitasking
Install this plugin and you should be all set. A future Cordova version will resolve the problem fully.
Failing that, if you are using remotebuild you can also find the native project under ~/.taco_home/remote-builds/taco-remote/builds and make the modifications as described in the Cordova bug on the issue.
EDIT:
To resolve ITMS-90339, there is a second step you can do to patch in the near term. Grab the build.xcconfig from the 3.9.x branch of the cordova-ios repo and place this under res/native/ios/cordova
Now remove this line:
CODE_SIGN_RESOURCE_RULES_PATH = $(SDKROOT)/ResourceRules.plist
Note that you will want to remove this custom build.xcconfig file if you upgrade to the version with the full patch that is forthcoming.

OneSignal Register for Push Notification is not working in Cordova

according to OneSignal's site just add this code to ask the user to allow the app to receive push notification :
window.plugins.OneSignal.registerForPushNotifications();
but it doesn't show up. And the device cannot register.
document.addEventListener("deviceready", function() {
window.plugins.OneSignal.init( "project_id",
{googleProjectNumber: "null_if_ios",
autoRegister: false},
mobile.didReceiveRemoteNotificationCallBack);
For Android, this works just fine. No need to call the registerForNotifications function.
The above code is for a much older version of the OneSignal Cordova SDK, make sure to use the latest version: https://documentation.onesignal.com/docs/cordova-sdk-setup
For Cordova and Cordova variants, many issues can be fixed by checking:
Your OneSignal appID does not have any extra spaces between the quotes.
You are using Cordova 6.4.0 or newer
If using CocoaPods, make sure you have version 1.2.0 or newer installed: https://documentation.onesignal.com/docs/cordova-sdk-setup#section-ios-requirements
You must test on an actual device, not the browser.
Update to the latest version of the OneSignal SDK, run:
cordova plugin rm onesignal-cordova-plugin
cordova plugin add onesignal-cordova-plugin
Many users simply need to make a clean build to remove the errors. Please see the Cordova Variants Troubleshooting guide: https://documentation.onesignal.com/docs/troubleshooting-cordova-variants
Finally, checkout the Github example to compare code:
Cordova Example: https://github.com/OneSignal/OneSignal-Cordova-Example
Ionic Example: https://github.com/OneSignal/OneSignal-Ionic-Example

Resources