cordova plugins delayed execution on iOS - ios

I am building an Ionic hybrid app and I have 4 plugins installed.
cordova-plugin-screen-orientation
cordova-plugin-app-version
cordova-plugin-geolocation
cordova-plugin-contacts
All of them work as expected on Android however, on iOS, whenever I trigger the plugin (usually with a button click), nothing happens, if I double click the app (or if I minimize and open up the app again), the plugins has executed and is displaying what I see on Android.
I have tried wrapping the call to the plugin in a $timeout but that didn't do anything different.
Any help would be appreciated as I have search all over hell on this and can't seem to find the issue.
Here is my apple setup:
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: MacOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.3.2 Build version 8E002

Related

When running 'ionic build ios' on macOS with node 7 I get stuck on this message: stdout maxBuffer exceeded. How could I solve it?

Suddenly I started having this problem when trying to build my iOS app with ionic build ios . I don't understand what could be causing it, because it was running just fine, then in the next day I get this message:
...
...
Running command: HC-Ionic/hooks/after_prepare/010_add_platform_class.js HC-Ionic
Running command: HC-Ionic/hooks/after_prepare/020_remove_sass_from_platforms.js HC-Ionic
stdout maxBuffer exceeded
The only thing I remember doing before this problem started happening was changing my node version sometimes using the application 'n'. But I already uninstalled the versions, set up the right one, but still was not able to figure out, trying to search on the internet.
This is my system info:
Cordova CLI: 8.1.2 (cordova-lib#8.1.1)
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS
Node Version: v7.10.1
Xcode version: Xcode 12.4 Build version 12D4e
This configuration is necessary because my app only runs with this node version.
Does anyone have any ideas?
I found a solution. Apparently I had too many simulators on xcode and this exceeded the json in the build. If the list exceeds 200kb, node 7 doesn't compile. Just removed some unnecessary simulators and it worked.
Node versions prior to v 12.x use a default maxBuffer value of 1 kilobyte (source), which is realtively small.
Later releases increased the default maxBuffer to 1 megabyte (source) - you should really consider upgrading as the release of Node you're running is ancient (EOL'd in 2017), at least by software standards.

Safari cannot open the page because the address is invalid when I do a google login using firebase and ionic v3

I’m facing a problem when I try to use the FireBase Google login.
When I log in to Google successfully and when it returns back on App iOS, I get this error:
Safari cannot open the page because the address is invalid msg
I do not know where the problem could be, because in Android, it works.
My system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.9.2
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 3.2.0
ios-deploy version: 2.0.0
ios-sim version: 3.0.0
OS: macOS
Node Version: v6.9.4
Xcode version: Xcode 10.1 Build version 10B61
i'm using this plugin (github.com/EddyVerbruggen/cordova-plugin-googleplus) and i think the new version... its fixed.

IOS build failing in IONIC

I am getting “Error: doc.find is not a function” error when IONIC is trying to do IOS build.
IONIC is able to build Android successfully. Only issue is with IOS.
Ionic Info Output -
Cordova CLI - 7.0.1
Ionic CLI Version - 2.1.18
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v4.4.4
Xcode version: Not installed
Any help is appreciated.

ionic platform add ios failed

When I try to run
ionic platform add ios
it fails with following error:
Couldn't find ionic.config.json file. Are you in an Ionic project?
Yes, I'm in an ionic project, called todo.
What do I do to fix this?
FYI, here is ionic info output:
Cordova CLI: 6.3.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.3.1
Xcode version: Xcode 7.3 Build version 7D175
Found a solution from this post in ionic forum.I'm just leaving the summary of the solutions if anyone needs it:
Solution 1:
Open a text editor.
Write following lines:
{
"name": "todo",
"app_id": ""
}
Note: app_idyour ionic cloud id. If you don't have one, leave it as is.
Save it as ionic.config.json in todo project directory.
Solution 2:
move to parent directory using cd ..
remove project directory using rm -r todo/. (caution: save your changes before removing).
create new project using ionic start todo blank command.
Restore your changes.
If the stated solutions don't work for you, uninstall and re-install ionic and Cordova/PhoneGap and try again.

Update phonegap cordova version

I am trying to update the latest cordova version to my project. I did run the below command:
$ sudo npm update -g cordova
after running this command, I checked and using cordova info command I can see that I have the latest version of cordova
Node version: v0.12.2
Cordova version: 5.3.1
Config.xml file:
However, when I go to the platform folder and ran
cordova platform version ios
The results is showing that I am still in the older version.
Installed platforms: ios 3.9.1
Available platforms: amazon-fireos, android, blackberry10, browser, firefoxos, osx, webos
I tried using the cordova platform update but I am getting an error, see below. Am I missing anything?
cordova platform update ios#5.3.1
Failed to fetch platform ios#5.3.1
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: version not found: cordova-ios#5.3.1
The various parts or cordova (cli, platforms, plugins) all move and release independently, which means they all can and will have different version numbers. For example the current release of the cordova-ios platform is 3.9.1 and the current release of android is 4.1.1. You can see what platforms are available by running
cordova platform list
You can see all published versions for a given platform via npm
npm view cordova-{platform} versions
replacing {platform} with anything given by the list command above.
Hope this helps!

Resources