GainzNCode
GainzNCode

Reputation: 1

Firebase push notification in MAUI ios

Anyone implemented firebase push notification on maui .NET 8
I followed a tutorial and it worked well on android , I am able to receive the push notifications but on iOS it is not receiving the push notification.

I followed this tutorial

Below is my mauiprogram.cs :

private static MauiAppBuilder RegisterFirebaseServices(this MauiAppBuilder builder)
{
    builder.ConfigureLifecycleEvents(events =>
    {
#if IOS
        events.AddiOS(iOS => iOS.WillFinishLaunching((_, __) =>
        {
            CrossFirebase.Initialize();
            FirebaseCloudMessagingImplementation.Initialize();
            return false;
        }));
#endif

#if ANDROID
        events.AddAndroid(android => android.OnCreate((activity, _) =>
            CrossFirebase.Initialize(activity)));
#endif
    });

    return builder;
}

I registered Firebase in maui like this:

.RegisterFirebaseServices()

Entitlement.plist :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>aps-environment</key>
        <string>development</string>
    </dict>
</plist>

Why doesn't it works on iOS? Do I need to specify any permission in info.plist in order to receive push notification on iOS?

Has anyone implemented firebase push notification in maui .net 8 on iOS as well as Android?

Upvotes: 0

Views: 47

Answers (0)

Related Questions