quickstart-ios icon indicating copy to clipboard operation
quickstart-ios copied to clipboard

FIRMessagingDelegate can not find declaration

Open atayuksel opened this issue 10 years ago • 13 comments

When I try to declare FIRMessagingDelegate in app delegate Xcode gives an error "Cannot find protocol declaration for FIRMessagingDelegate".

I imported firebase as implemented in the project

#import <UIKit/UIKit.h>
#import <UserNotifications/UserNotifications.h>
#import <MessageUI/MessageUI.h>

#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@import UserNotifications;
#endif

@import Firebase;
@import FirebaseInstanceID;
@import FirebaseMessaging;

@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate, FIRMessagingDelegate>

I imported firebase via cocoa pods and response is Installing Firebase 3.2.1 (was 3.2.0) Using FirebaseAnalytics (3.2.0) Using FirebaseInstanceID (1.0.6) Using FirebaseMessaging (1.1.0)

Everything seems fine but I could not solve the problem anyway? What could be reason for the problem?

atayuksel avatar Sep 23 '16 10:09 atayuksel

I updated the cocoapod version (had 0.39.0) and now 1.0.1...

check version by entering: pod --version

then install the newest version with: gem install cocoapods

Benjaminm5 avatar Sep 23 '16 12:09 Benjaminm5

Now I updated pods, It works well, thanks 👍

atayuksel avatar Sep 23 '16 14:09 atayuksel

"pod update" solved the problem. Thank you!

ghost avatar Sep 26 '16 09:09 ghost

I already have pod version 1.0.1 but yet I get the same problem. How to solve it

MaxBerny avatar Dec 07 '16 14:12 MaxBerny

@MaxBerny After updating to cocoapod version 1.0.1 , run pod update, it will solve your problem.

anand-y avatar Dec 26 '16 07:12 anand-y

How can you update to 1.0.1? 1.1.1 is the latest version.

revolter avatar Dec 27 '16 20:12 revolter

1.1.1 should work!

1.0.1 or newer...

Am 27. Dez. 2016, 21:03 +0100 schrieb Iulian Onofrei [email protected]:

How can you update to 1.0.1? 1.1.1 is the latest version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/firebase/quickstart-ios/issues/107#issuecomment-269375578), or mute the thread (https://github.com/notifications/unsubscribe-auth/ALw0AGfq_IXx2tf5Op_EWde7qE-y-Ch9ks5rMW7-gaJpZM4KEz00).

Benjaminm5 avatar Dec 27 '16 21:12 Benjaminm5

Although I updated the pods the problem remained. I fixed it by moving @import Firebase; @import FirebaseInstanceID; @import FirebaseMessaging; above the interface declaration (it was below by mistake)

i6mi6 avatar Jan 06 '17 09:01 i6mi6

i tried all the suggestion still not working 😞. i am on pod version 1.1.1 and even if i go into Xcode doc of messaging() i didn't find the "remoteMessageDelegate".

Anilkumarkotur avatar Jan 17 '17 09:01 Anilkumarkotur

i am on pod version 1.1.1 but still I didn't find the "remoteMessageDelegate".

gnani1234 avatar Apr 13 '17 10:04 gnani1234

i have the same problem i haven't find remoteMessageDelegate yet

compbealov avatar Apr 20 '17 15:04 compbealov

Actually this was my mistake, as i was migrating from GCM to FCM, first i need to remove the GCM framework and i have to add FCM. but i was adding FCM on top of GCM so i got into an state where i was facing duplication issue with one the class which in both GCM and FCM. while resolve it podfile.lock was acting very weird and this is the reason for mess. https://developers.google.com/cloud-messaging/ios/ios-migrate-fcm

Thanks

Anilkumarkotur avatar May 08 '17 09:05 Anilkumarkotur

In my case,I've tried to update the pod and it failed.Then I deleted the podfile.lock and run pod install** It finally works!

HaileApp avatar Feb 26 '18 12:02 HaileApp