Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic - Add/Remove phonegap-push-plugin - CocoaPods was not found

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 ionic plugin add phonegap-plugin-push 

I get the below error:

Error: CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/ 

I've obviously tried installing this software as the error suggests, but I cannot find version 1.0.1 anywhere.

I'd also like to understand what this is required for and why Ionic thinks it needs it.

Thanks a lot

like image 443
Martin Crawley Avatar asked Dec 10 '16 18:12

Martin Crawley


1 Answers

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" 
like image 144
Matt Avatar answered Sep 19 '22 20:09

Matt