Open gordonsaxby opened 3 years ago
@gordonsaxby I'm running the same version without problems. Did you add it after Xamarin.Forms.Forms.Init(); ?
I have followed the video here https://www.youtube.com/watch?v=GNBuaAB8nR8& and also the Android version and added all code, done all setup as per the videos.
The Android App runs fine and can receive notifications from Firebase. The iOS version compiles / installs, starts up and shows the default splash screen for 17 seconds and then the app stops (actually minimises) and debugging stops. No breakpoints within the iOS or shared projects are reached.
In your Main.cs replace this;
UIApplication.Main(args, null, nameof(AppDelegate));
with:
try
{
UIApplication.Main(args, null, nameof(AppDelegate));
}
catch (Exception e)
{
try
{
Debug.WriteLine(e.Message);
Debug.WriteLine(e.StackTrace);
Debug.WriteLine(e.Source);
Debug.WriteLine(e.InnerException?.StackTrace);
Debug.WriteLine(e.InnerException?.Source);
//var data = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
//var filename = Path.Combine(data, String.Format("crash.txt"));
//File.WriteAllText(filename, e.Message + "\n-----\n" + e.StackTrace ?? "" + "\n-----\n" + e.Source ?? "" + "\n-----\n");
}
catch (DirectoryNotFoundException)
{
}
}
and see if that exception gives you a better clue of what is going on.
It doesn't reach that point. I added a breakpoint to the first WriteLine and it didn't hit it.
BTW, I am currently using a Mac at MacInCloud - could that be causing any issues?
Update: Found a different iPhone and that one does report an error (why on earth isn't my iPhone doing that?!?!?!?)
Object reference not set to an instance of an object.
Thread started: <Thread Pool> #8
[0:] at Plugin.FirebasePushNotification.FirebasePushNotificationManager.Initialize (Foundation.NSDictionary options, System.Boolean autoRegistration) [0x00029] in /Users/runner/runners/2.169.1/work/1/s/Plugin.FirebasePushNotification/FirebasePushNotificationManager.ios.cs:141
at MyApp.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00030] in C:\Development\MyApp\trunk\MyApp\MyApp\MyApp.iOS\AppDelegate.cs:62
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:65
at MyApp.iOS.Application.Main (System.String[] args) [0x00002] in C:\Development\MyApp\trunk\MyApp\MyApp\MyApp.iOS\Main.cs:17
@gordonsaxby if you don't mind sharing your code (under NDA), I could have a quick look on my Macbook. I see that this issue is reported here a couple of times. I don't have it so I think I will be able to figure it out. I will send you a tweet so you know how to contact me.
I now have a physical Mac (MacBook Pro 2018) and the app works fine when run in debug mode from it (using Visual Studio 2019 for Mac). So, I can at least continue development, I just have to do testing of the iOS app from the MacBook.
Not really a solution, but at least shows the plugin does work. And that there is some sort of issue with using it via Windows.
@jtorvald i have same issue on iPhone 7 iOS v14.6 and package version 3.3.10
I have the same issue, can some one fix this ?
I had the same issue.
It was that it couldn't find the GoogleService-info.plist, I resolved it by set the build option of the file:
I don't know if this can help you.
Paulpetta668 you work on Windows or MacOS ?
Paulpetta668 you work on Windows or macOS?
I work on Windows
I'm having exactly the same problem with VS in Windows. Already checked Build Action for GoogleService-info.plist and all the configurations... In Android works like a charm.
Could it be possible to have a fix or workaround?
I'm having exactly the same problem with VS in Windows. Already checked Build Action for GoogleService-info.plist and all the configurations... In Android works like a charm.
Could it be possible to have a fix or workaround?
Other than the build action I see no workarounds neither fixes. Are u using the simulator?
No, a physical iPhone
For now it only works from Mac.
We have the same issue, any idea how to fix this?
Install VS on Mac, and create release there, on Windows not working :(
We are building on Azure Pipelines with Image: macOS-10.15 with the same result.
We fixed our issue adding InvokeOnMainThread
CrossFirebasePushNotification.Current.OnNotificationError += (source, args) =>
{
InvokeOnMainThread(
() => new UIAlertView(
"Error registering push notifications",
args.Message,
null as IUIAlertViewDelegate,
"OK",
null).Show());
};
I'm having the same issue on a mac. I'm using VS 2019 for Mac with an iPhone 8 (14.0.1). I followed the same video by Gerald. The app opens to a blue screen for about 2 seconds and then disappears. The debugger spins and eventually times out. I added the try catch block around the UIApplication.Main call as well as the Intiialize call. Neither of them are hit. The only thing that shows in the application output is below. One thing that is different is that I have other Firebase components (Xamarin.Firebase.iOS.Auth(6.2.1.2), Xamarin.Firebase.iOS.Analytics(6.0.4.1), Xamarin.Firebase.iOS.Database(6.1.4), Xamarin.Firebase.iOS.Core(6.1.0.1).
Any suggestions?
*Edit - the iPhone is a physical device
2021-10-05 20:53:23.200 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.SpriteKitQuickLookProvider of plug-in com.apple.IDESpriteKitParticleEditor 2021-10-05 20:53:23.201 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.SpriteKit.GKStateMachineQuickLookProvider of plug-in com.apple.IDESpriteKitParticleEditor 2021-10-05 20:53:23.213 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.GPUMatrixQuickLookProvider of plug-in com.apple.dt.gpu.GPUDebugger 2021-10-05 20:53:23.213 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.MTLDebugSamplerState of plug-in com.apple.dt.gpu.GPUDebugger 2021-10-05 20:53:23.213 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.MTLDebugTexture of plug-in com.apple.dt.gpu.GPUDebugger 2021-10-05 20:53:23.213 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.GPUIssueQuickLookProvider of plug-in com.apple.dt.gpu.GPUDebugger 2021-10-05 20:53:23.214 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.IDEDebugger.VariablesViewQuickLookProvider for extension Xcode.IDEDebugger.MTLDebugBuffer of plug-in com.apple.dt.gpu.GPUDebugger 2021-10-05 20:53:23.214 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.ViewDescriber for extension Xcode.DebuggerFoundation.watchOSSimulator.ViewDescriber of plug-in com.apple.dt.IDEWatchSupportUI 2021-10-05 20:53:23.214 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.DataSourceConnection for extension Xcode.DebuggerFoundation.watchOSSimulator.DataSourceConnectionTargetHub of plug-in com.apple.dt.IDEWatchSupportUI 2021-10-05 20:53:23.214 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.ViewDescriber for extension Xcode.DebuggerFoundation.watchOS.ViewDescriber of plug-in com.apple.dt.IDEWatchSupportUI 2021-10-05 20:53:23.214 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.DataSourceConnection for extension Xcode.DebuggerFoundation.watchOS.DataSourceConnectionTargetHub of plug-in com.apple.dt.IDEWatchSupportUI 2021-10-05 20:53:23.215 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.DataSourceConnection for extension Xcode.DebuggerFoundation.tvOSSimulator.DataSourceConnectionTargetHub of plug-in com.apple.dt.IDEAppleTVSupportUI 2021-10-05 20:53:23.215 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.ViewDescriber for extension Xcode.DebuggerFoundation.ATVSimulator.ViewDescriber of plug-in com.apple.dt.IDEAppleTVSupportUI 2021-10-05 20:53:23.215 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.ViewDescriber for extension Xcode.DebuggerFoundation.ATV.ViewDescriber of plug-in com.apple.dt.IDEAppleTVSupportUI 2021-10-05 20:53:23.215 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.DataSourceConnection for extension Xcode.DebuggerFoundation.tvOS.DataSourceConnectionTargetHub of plug-in com.apple.dt.IDEAppleTVSupportUI 2021-10-05 20:53:23.215 mlaunch[11846:232770] Requested but did not find extension point with identifier Xcode.DebuggerFoundation.DeviceIconProvider for extension Xcode.DebuggerFoundation.DeviceIconProvider.AppleTV of plug-in com.apple.dt.IDEAppleTVSupportUI Launched application 'com.kaolinsoftware.polyamdate' on 'Leeland???s iPhone' with pid 532 dyld: dependent dylib '@rpath/protobuf.framework/protobuf' not found for '/private/var/containers/Bundle/Application/2FBF94D8-A0BB-4DEB-A04A-62F01DF59647/Kaolin.PolyAmDate.Mobile.iOS.app/Frameworks/FirebaseMessaging.framework/FirebaseMessaging', tried but didn't find: '/private/var/containers/Bundle/Application/2FBF94D8-A0BB-4DEB-A04A-62F01DF59647/Kaolin.PolyAmDate.Mobile.iOS.app/Frameworks/protobuf.framework/protobuf' '/private/var/containers/Bundle/Application/2FBF94D8-A0BB-4DEB-A04A-62F01DF59647/Kaolin.PolyAmDate.Mobile.iOS.app/Frameworks/FirebaseMessaging.framework/Frameworks/protobuf.framework/protobuf' '@rpath/protobuf.framework/protobuf' '/System/Library/Frameworks/protobuf.framework/protobuf' Application 'com.kaolinsoftware.polyamdate' terminated (with exit code '' and/or crashing signal '6).
Same problem. Does somebody know a workaround with Windows?
Facing same problem. Any workaround?
face the same problem, help
Same issue with an iPhone 13 connected to a Mac M1.
Facing the same problem, and if this was closed "fixed" I would love to know what the fix was, version, details, example that actually works. There's no details.
So does that mean effectively iOS remote notifications are completely blocked/broken for MAUI?
Does anyone have this actually working - now?
I've tried with Shiny, community toolkit, Plugin.Firebase, and others... no luck.
After struggling with this for a week now I am about to throw in the towel and hire a SWIFT developer instead.
I solved mine by adding the firebase core initialization above LoadApplication. Sample code is below:
`Firebase.Core.App.Configure();
LoadApplication(new App());
FirebasePushNotificationManager.Initialize(options, true);`
Hope this helps anyone.
hi Polieadie I tried but it didn't work
I solved mine by adding the firebase core initialization above LoadApplication. Sample code is below:
`Firebase.Core.App.Configure();
LoadApplication(new App());
FirebasePushNotificationManager.Initialize(options, true);`
Hope this helps anyone.
ty for help but i have the same error
{System.NullReferenceException: Object reference not set to an instance of an object. at Plugin.FirebasePushNotification.FirebasePushNotificationManager.Initialize (Foundation.NSDictionary options, System.Boolean autoRegistration) [0x00029] in /Users/runner/work/1/s/Plugin.FirebasePushNotification/FirebasePushNotificationManager.ios.cs:141 at Admh.Clientes.Movil.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00013] in C:\Proyectos\admh\Admh.Clientes.Movil.iOS\AppDelegate.cs:69 at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,intptr,intptr,intptr,intptr&) at UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, System.IntPtr delegateClassName) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.6/src/Xamarin.iOS/UIKit/UIApplication.cs:58 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.6/src/Xamarin.iOS/UIKit/UIApplication.cs:84 at Admh.Clientes.Movil.iOS.Application.Main (System.String[] args) [0x00002] in C:\Proyectos\admh\Admh.Clientes.Movil.iOS\Main.cs:26 }
btw i am working in visual studio windows xamarin.ios
Help please someone!
Please try below as well.
Please try below as well.
thanks for your prompt response, I already tried but it didn't work
I am working from my windows laptop remotely connected to my mac
I followed the tutorial: https://www.youtube.com/watch?v=GNBuaAB8nR8&ab_channel=GeraldVersluis
I get the token, connected from the emulator, but when I try to test sending a notification from firebase messaging it never arrives,
I try to use my physical iPad but it returns the following error:
{System.NullReferenceException: Object reference not set to an instance of an object. at Plugin.FirebasePushNotification.FirebasePushNotificationManager.Initialize (Foundation.NSDictionary options, System.Boolean autoRegistration) [0x00029] in /Users/runner/work/1/s/Plugin.FirebasePushNotification/FirebasePushNotificationManager.ios.cs:141 at Plugin.FirebasePushNotification.FirebasePushNotificationManager.Initialize (Foundation.NSDictionary options, Plugin.FirebasePushNotification.NotificationUserCategory[] notificationUserCategories, System.Boolean autoRegistration) [0x00000] in /Users/runner/work/1/s/Plugin.Fire basePushNotification/FirebasePushNotificationManager.ios .cs:176 at Admh.Clientes.Movil.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00013] in C:\Proyectos\admh\Admh.Clientes.Movil.iOS\AppDelegate.cs:47 at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,intptr,intptr,intptr,intptr&) at UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, System.IntPtr delegateClassName) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.6/ src/Xamarin.iOS/UIKit/UIApplication.cs:58 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.6/src/Xamarin.iOS /UIKit/UIApplication.cs:84 at Admh.Customers.Mobile.iOS.Application.Main (System.String[] args) [0x00002] in C:\Projects\admh\Admh.Customers.Mobile.iOS\Main.cs:26 }
when i use postman it returns:
{ "multicast_id": 4097073816387638982, "success": 0, "failure": 1, "canonical_ids": 0, "results": [ { "error": "NotRegistered" } ] }
Any fix? Same issue xamarin.ios on Windows VS Code 2022.
We ended up abandoning the use of this plugin and implemented FCM services directly. This plugin uses the old method to get the token. Now the notifications and GA4 work well for us again with the current versions of the google libraries.
We ended up abandoning the use of this plugin and implemented FCM services directly. This plugin uses the old method to get the token. Now the notifications and GA4 work well for us again with the current versions of the google libraries.
Can you please share your solution because i struggel with it myself for over 2 weeks now
🐛 Bug Report
App crashes at FirebasePushNotificationManager.Initialize with error:
{System.NullReferenceException: Object reference not set to an instance of an object. at Plugin.FirebasePushNotification.FirebasePushNotificationManager.Initialize (Foundation.NSDictionary options, System.Boolean autoRegistration) [0x00029] in /Users/runner/runners/2.169.1/work/1/s/Plugin.FirebasePushNotification/FirebasePushNotificationManager.ios.cs:141 at MyApp.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00014] in ....\MyApp\MyApp.iOS\AppDelegate.cs:34 }
Expected behavior
Not to crash
Reproduction steps
Create basic Xamarin Forms project with Visual Studio 2019. Add this Nuget package, add FirebasePushNotificationManager.Initialize(options, true); to AppDelegate.cs. Run on iPhone iOS v14.5
Configuration
Version:
3.3.10
Platform: