• Mobile
  • Extensions
  • Releases
  • GitHub
  • Blog
  • Sponsor
Show / Hide Table of Contents
  • Home
  • Quick Start
  • Setup
    • Dependency Injection
    • Startup
    • Static Instances
    • iOS
    • Android
  • Configuration Extensions
  • Jobs
    • Setup
    • Create a Job
    • Querying, Cancelling, and Adhoc
    • Frequently Asked Questions
  • Bluetooth LE Client
    • Setup
    • Scanning
    • Peripheral
    • Best Practices
    • Manged Scanning
    • Managed Peripheral
  • Bluetooth LE Hosting
    • Setup
    • GATT
    • Advertising
  • Geofencing
  • GPS
    • Setup
  • Motion Activity
  • Local Notifications
    • Getting Started
    • Channels
  • Push Notifications
    • Getting Started
    • Native
    • Azure Notification Hubs
    • Firebase Messaging
    • One Signal
  • Beacons
    • Ranging
    • Monitoring (Background)
  • HTTP Transfers
    • Getting Started
    • Advanced
  • Framework
    • Getting Started
    • ViewModel
  • Sensors
    • Getting Started
    • Accelerometer
    • Ambient Light
    • Barometer
    • Compass
    • Gyroscope
    • Humidity
    • Magnetometer
    • Pedometer
    • Proximity
    • Temperature

Push

Firebase Push Provider for iOS and Android

Area Value
NuGet Shiny.Push.FirebaseMessaging
Service Shiny.Push.IPushManager
Auto-Register NO
Delegate Shiny.Push.IPushDelegate
Static Class ShinyPush

Startup File

using Microsoft.Extensions.DependencyInjection;
using Shiny;

namespace YourNamespace
{
    public class YourShinyStartup : ShinyStartup
    {
        public override void ConfigureServices(IServiceCollection services, IPlatform platform)
        {
            services.UseFirebaseMessaging<MyPushDelegate>();
        }
    }
}

Platform Setup

  • iOS
  • Android

Minimum Version: 12

AppDelegate

using System;
using Foundation;
using Xamarin.Forms.Platform.iOS;
using Shiny;

namespace YourIosApp
{
    [Register("AppDelegate")]
    public partial class AppDelegate : FormsApplicationDelegate
    {
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            this.ShinyFinishedLaunching(new Samples.SampleStartup(), options);
            global::Xamarin.Forms.Forms.Init();
            this.LoadApplication(new Samples.App());
        }
    }

    public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        => this.ShinyRegisteredForRemoteNotifications(deviceToken);

    public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
        => this.ShinyFailedToRegisterForRemoteNotifications(error);

    public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
        => this.ShinyDidReceiveRemoteNotification(userInfo, completionHandler);
}

Info.plist

<!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version=\"1.0\">
    <dict>
        <key>UIBackgroundModes</key>
        <array>
            <string>remote-notification</string>
        </array>
    </dict>
</plist>

Entitlements.plist

<!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 OR production</string>
    </dict>
</plist>

Minimum Version: 8.0

Target Version: 12

Samples

  • https://github.com/shinyorg/samples/tree/main/Push
  • Improve this Doc
In This Article
Back to top Generated by DocFX