1

I'm following this official guide for Google Cloud Messaging for iOS :

Start with the sample using the following command from a terminal:

pod try Google

Select the option for GcmExample.xcodeproj from the prompt.

But here's my console output:

pod try Google

Updating spec repositories

Trying Google
1: Samples/analytics/AnalyticsExample.xcodeproj
2: Samples/signin/SignInExample.xcodeproj
Which project would you like to open

There is no option for GcmExample at all.

Community
  • 1
  • 1
My other car is a cadr
  • 1,429
  • 1
  • 13
  • 21

2 Answers2

2

I also couldn't find this directory, My solution is fire up your terminal and hit ->

->cd yourCloningDirectory
->git clone https://github.com/googlesamples/google-services.git

then after cloning or downloading

->cd google-services(downloaded directory)->ios->gcm->

Here is your GCMExample.xcodeproj.

->pod install

(if failed to install/not found repo,try updating the Podfile like

source 'https://github.com/CocoaPods/Specs.git'

pod 'Google/CloudMessaging' )

->open GCMExample.xcworkspace

Here is your working demo project.

Rafat touqir Rafsun
  • 2,777
  • 28
  • 24
0

The new version of Google Cloud Messaging (GCM) is Firebase Cloud Messaging (FCM). New code should use Firebase pod and not the Google pod. For the FCM sample, you can do

pod try Firebase

and select Samples/messaging/FCM.xcodeproj from the list

user102008
  • 30,736
  • 10
  • 83
  • 104
  • GCM has not been deprecated, it will still work as it previously did. However it is not in the list of Google try projects. You should give FCM a try via pod try Firebase. – Arthur Thompson May 25 '16 at 23:51
  • I already have GCM implemented on the backend and on the Android app. I am fully vested in GCM. I cannot afford to switch to Firebase. To Google: you released GCM in 2012, please don't deprecated it so soon and screw me like this. – My other car is a cadr May 26 '16 at 05:04
  • @Myothercarisacadr: The APIs of FCM and GCM are pretty analogous and it should be very easy to change. Alternately, you can look at the [podspec for Google 2.0.4](https://github.com/CocoaPods/Specs/blob/master/Specs/Google/2.0.4/Google.podspec.json) (the previous version before the removed all of the services), manually download the package from the URL in there, and then look at the Samples directory in that. – user102008 May 26 '16 at 18:26