Firebase "RemoteMessage" not found, VS Version 8.10.18 (build 11), CloudMessaging 8.10.0

Pat Caruthers
96
Reputation points
My ios application uses Firebase Cloud Messaging.
I updated VS this morning to Version 8.10.18 (build 11) and also all of the packages
I have:
Xamarin.Firebase.iOS.CloudMessaging 8.10.0
Xamarin.Firebase.iOS.Core 8.10.0
Xamarin.Firebase.iOS.Installations 8.10.0
Xamarin.Firebase.iOS.InstanceID 4.8.0
My app was compiling and working before the update but now gets this error:
Error CS0246: The type or namespace name 'RemoteMessage' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Anyone know the fix?
{count} votes
i have previously tried removing the bin/obj folders, but that did not help.
after removing all the packages i find that i cannot add "Xamarin.Firebase.iOS.CloudMessaging" -- it does not appear in the package list although here IS a Xamarin.Firebase.iOS.CloudMessaging on nuget.org.
You couldn't search for this package under Browse, right?
Perhaps I just didn't look hard enough - i was sure it wasn't there under Browse, but today i found it, so ...
However installing that package does Not fix the original problem, i still get this error:
Error CS0246: The type or namespace name 'RemoteMessage' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
I restored a backup of both VS and my project. Some experimentation shows the problem is something in the packages that were updated, not the VS update itself.
The packages which work are, some of them, quite out of date, so my guess is that RemoteMessage moved in some way between the versions i had before and the new ones.
So the question is -- where is RemoteMessage now (or what has it been replaced with?)
Did you update the .net framework when updating the VS? I 'm afraid you reference the assembly that was built against a higher framework version than the target framework of the program. And I noticed that
Xamarin.Firebase.iOS.InstanceID 4.8.0
didn't update. You could try to create a new issue at https://github.com/xamarin/GoogleApisForiOSComponents/issues.Sign in to comment
1 answer
Sort by: Most helpful
Solved --
Looking at the AppDelegate.cs file for the CloudMessaging sample (on git hub) shows the fix is to simply remove the code that references RemoteMessage. Apparently things have been cleaned up so it is no longer needed.
I removed those lines, updated the packages and things compile and seem to be working.
Thanks for your sharing.
Do you have a link to an example of the new signature?
[Export("messaging:didReceiveMessage:")]
public async void DidReceiveMessage(Messaging messaging, RemoteMessaging remoteMessage)
I tried removing the RemoteMessaging parameter as you suggest but that fails and says the signature doesn't match. I've searched everywhere for this and no where is this mentioned on the internet. Why did they change the signature and not update their documentation? I've looked at the git but the samples don't include an example for RemoteMessaging.
Any help here would be greatly appreciated.
Thanks,
Sign in to comment
Activity