Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maui-Firebase.Cloudmessage.SharedInstance is always null (window pc) #19182

Closed
Tracked by #19926
gabsamples6 opened this issue Oct 12, 2023 · 15 comments
Closed
Tracked by #19926

Maui-Firebase.Cloudmessage.SharedInstance is always null (window pc) #19182

gabsamples6 opened this issue Oct 12, 2023 · 15 comments
Assignees
Labels
hotrestart need-info Waiting for more information before the bug can be investigated windows-only The issue only occur on Windows
Milestone

Comments

@gabsamples6
Copy link

gabsamples6 commented Oct 12, 2023

@rolfbjarne
As requested I have created this new issue and attached a noddy project - I could not put the original entitlements etc.. so if you could replace those as mentioned below that would be great..

The main purpose of this issue is to prove that SharedInstance is always null when running on a windows pc. Hopefully I am missing the obvious..

Many thanks

Steps to Reproduce

  1. Windows pc with iPhone attached via usb.
  2. Unzip the attached project
  3. replace the Entitlement.plist and googleService-info.plist with yours
  4. replace the App Identifier to match yours in csproj.
  5. Build the project again.
  6. Run the project
  7. Press register button
  8. there are 2 lines of code
    Firebase.Core.App.Configure();
    Messaging.SharedInstance.AutoInitEnabled = true;
  9. SharedInstance is always null when running the app from a phisycal iPhone device attached to a win 11 PC.

Note - it will compile once the correct entitlement.plist and googleService-info.plist have been replaced.

I get
image

image

Expected Behavior

SharedInstance should not be null

Actual Behavior

SharedInstance should is null

Environment

Example Project (If Possible)

MauiPushiOS.zip

@TedMobile
Copy link

Hi
I have been trying to do some push notification and I cannot go any further on iOS because of this issue, I believe this is a long standing issue and I think people overcome it using a MAC but I dont have a mac and I use a window PC for development too.

just in 5 mins I have found these issue all related to SharedInstance being null, none of the possible workaround suggested works

xamarin/GoogleApisForiOSComponents#621
xamarin/GoogleApisForiOSComponents#486
https://stackoverflow.com/questions/76677155/messaging-sharedinstance-delegate-this-is-null-in-xamarin-ios

Can someone please have a look and tell us what are we doing wrong?
@rolfbjarne @dalexsoto sorry for tagging but we cannot set up push notification for iOS and it s become critical as it is key feature and we cannot debug or set up notification using a PC and an iPhone plugged into pc.

Many thanks

@rolfbjarne rolfbjarne added the windows-only The issue only occur on Windows label Oct 20, 2023
@rolfbjarne rolfbjarne self-assigned this Oct 20, 2023
@rolfbjarne
Copy link
Member

I can reproduce this, I'll see what we can do.

@rolfbjarne rolfbjarne added this to the Future milestone Oct 20, 2023
@gabsamples6
Copy link
Author

@rolfbjarne that would be a game changer for us.. I just hope you can find some time to fix this. thanks!

@rolfbjarne
Copy link
Member

I think I've been able to fix this, but I'm not sure we'll be able to get all the fixes (there were quite a few) into the first .NET 8 release. If not, we'll include them in a service release.

@gabsamples6
Copy link
Author

oh that is great news that you have fix!!!! To get them in .net 8 GA would be fantastic and enable us to promote push notification to our clients for MAUI - we are kind of holding on what to say as we dont have a working solution.

Regardless we totally appreciate any updates you might give us -

@rolfbjarne rolfbjarne modified the milestones: Future, .NET 8 Oct 26, 2023
@rolfbjarne
Copy link
Member

Closing, this is fixed and it looks like we'll get it in .NET 8.

@gabsamples6
Copy link
Author

That’s brilliant thanks for sorting for fixing this

@gabsamples6
Copy link
Author

@rolfbjarne just tested on the latest .net 8 rtm and SharedInstance is still null. Is this the case at your end?

We cannot move on with push notification till this is sorted. Many thanks in advance

@Mercally
Copy link

Mercally commented Dec 3, 2023

Is this related to Google.SignIn.SignIn.SharedInstance ? I'm getting NullReferenceException on that field. Using NET MAUI 8, testing on iOS 17.0.1 Any idea?

@gabsamples6
Copy link
Author

@rolfbjarne could this be looked at and reopened as it’s still an issue? Thanks

@rolfbjarne rolfbjarne reopened this Dec 4, 2023
@rolfbjarne rolfbjarne modified the milestones: .NET 8, .NET 9 Dec 4, 2023
@rolfbjarne
Copy link
Member

I'll have a look

@gabsamples6
Copy link
Author

@rolfbjarne hi grateful for some news on this one. Notifications is one of the most important features of the app and I hope that by setting the milestone to .net 9 we do not have to wait till then .

Any chance of a fix with next SR maui release?

@rolfbjarne
Copy link
Member

I can't reproduce this with .NET 8, the SharedInstance property is not null now.

Can you get a binlog as described here and attach it to this issue: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#build-logs?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Dec 22, 2023
Copy link
Contributor

Hi @gabsamples6. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@gabsamples6
Copy link
Author

@rolfbjarne YES. it works and its no longer null!! thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotrestart need-info Waiting for more information before the bug can be investigated windows-only The issue only occur on Windows
Projects
None yet
Development

No branches or pull requests

4 participants