2

enter image description here

I am developing an iPhone app using Xcode 7 beta 4 in Swift 2.0

I am trying to implement GCM push notifications following the google doc here

I have followed and completed the steps upto "Add the configuration file to your project". Now when I am trying to add "#import < Google/CloudMessaging.h >" in the file. I am getting error. The error is Consecutive statements on a line must be separated by ';' I think the import statement is not working. Can some one please tell me how I can do it in the correct way?

Somir Saikia
  • 1,610
  • 1
  • 16
  • 21

1 Answers1

1

The "#import <Google/CloudMessaging.h>" needs to be in your bridging header (which is a .h file), not in your .swift file.

You do have a bridging header file, don't you?

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Do I need to edit the current bridging header file or I will have to create new bridging header file. I am very new to the platfrom. I do not understand much. It will be very kind of you if you can forward me a good tutorial of GCM using xcode7 in swift. Thanks – Somir Saikia Aug 12 '15 at 06:00
  • 1
    remove the #import from the .swift file, add it to the current bridging header file, and let's see if it compiles. :-) – Michael Dautermann Aug 12 '15 at 06:01
  • It is compiling I was adding the import in the wrong place. Now if I write rest of the code for notification I suppose it will work. Thanks for the help. – Somir Saikia Aug 12 '15 at 06:08
  • glad I was able to assist! – Michael Dautermann Aug 12 '15 at 06:52