1

I'm using the new Plugin.Firebase plugin to get push notification function working with a clean .NET Maui app-project.

I have installed https://github.com/TobiasBuchholz/Plugin.Firebase but for some reson this code is "unreachable" or it does not exist in namespace.

#if IOS
using Plugin.Firebase.iOS; <-- Error: code is "unreachable" or it does not exist in namespace
#else
using Plugin.Firebase.Android;
#endif

Does anyone else have the same problem or knows any workarount the problem. Android seems to work as it should to, but I dont understand why. I have compared the source code of both iOS and Android and the namespace should exist in both cases:

https://github.com/TobiasBuchholz/Plugin.Firebase/blob/development/src/Android/CrossFirebase.cs

https://github.com/TobiasBuchholz/Plugin.Firebase/blob/development/src/iOS/CrossFirebase.cs

Nabil Akhlaque
  • 192
  • 1
  • 8
  • It seems like this is a issue with visual studio. Just remove #if from around the namespace. Clean bin & obj and restart Visual studio. Build the project targeting iOS. If it works than again put the namespace within #if – Paramjit Feb 21 '23 at 04:44
  • Tried that, still have the same issue. – Nabil Akhlaque Feb 21 '23 at 20:36
  • Same issue but with Android. I haven't set up iOS yet, but I'm assuming I would have the same issue. – Zonus Feb 22 '23 at 17:05

1 Answers1

1

Seems there is a bug report on it, it refers to another bug which refers to another one.

https://github.com/TobiasBuchholz/Plugin.Firebase/issues/125

Zonus
  • 2,313
  • 2
  • 26
  • 48
  • I do understand, the bug part. What I dont understand is "why"... the method is public so why cant I access it? whats restricting my access? – Nabil Akhlaque Feb 26 '23 at 00:07
  • I was eventually able to work through it. Follow this guide closely, especially when it comes to editing the project file. That is where the issue was for me. https://github.com/TobiasBuchholz/Plugin.Firebase#net-maui-support – Zonus Feb 28 '23 at 14:36
  • Sorry, my bad. This is the URL with the project editing information: https://cedricgabrang.medium.com/firebase-push-notifications-in-net-maui-ios-2f4388bf1ac – Zonus Feb 28 '23 at 14:55