I\'m writing an Ionic app but I\'m getting so many issues. One issue in particular is that when I try to add the phonegap-push-plugin using the command
sudo ioni
To install push
you must first install cocoapods
. Follow these steps on your terminal in the Ionic project directory.
First remove what you tried to install
ionic cordova plugin remove phonegap-plugin-push
Next install cocoapods
sudo gem install cocoapods
Then you need to sync the cocoapods repo
pod setup
This may take a while
Finally install push
ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
Try without "sudo": cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
More information : here
The accepted solution to this didn't work for me, I had to install an older version of cocoapods:
sudo gem uninstall cocoapods
If using brew, run this too: brew uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
pod setup
Then reinstall the plugin with ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
(As per part of https://github.com/flutter/flutter/issues/41253)