• Mobile
  • Extensions
  • Releases
  • GitHub
  • Blog
  • Sponsor
Show / Hide Table of Contents
  • Push Notification Management
    • Managing Registrations
    • Notification Reporters
    • Decorators
    • Custom Data Store
    • Configuration Providers
  • Mail Engine
  • Localization
  • Web Hooks

Configuration Providers

Configuration providers were spawned out of the need for multitenancy without the need for mucking up our push providers. For single tenant, you won't even realize these things are there.

Custom Provider

  1. Implement the Shiny.Extensions.Push.Providers.IAppleConfigurationProvider and/or IGoogleConfigurationProvider
namespace YourNamespace;

using Microsoft.EntityFrameworkCore;
using Shiny.Extensions.Push;
using Shiny.Extensions.Push.Providers;
using System.Threading.Tasks;


public class PushConfigurationProvider : IAppleConfigurationProvider, IGoogleConfigurationProvider
{
    public async Task<GoogleConfiguration> GetConfiguration(Notification notification)
    {
        var cfg = await this.GetConfig(notification).ConfigureAwait(false);
        return new GoogleConfiguration
        {
            SenderId = cfg.GooglePushSenderId,
            ServerKey = cfg.GooglePushServerKey,
            UseShinyAndroidPushIntent = true
        };
    }


    async Task<AppleConfiguration> IAppleConfigurationProvider.GetConfiguration(Notification notification)
    {
        var cfg = await this.GetConfig(notification).ConfigureAwait(false);
        return new AppleConfiguration
        {
            TeamId = cfg.ApplePushTeamId,
            Key = cfg.ApplePushKey,
            KeyId = cfg.ApplePushKeyId,
            AppBundleIdentifier = cfg.ApplePushAppBundleIdentifier,
            IsProduction = cfg.ApplePushProduction
        };
    }

    async 
}
  1. Register it with your DI container
services.AddPushManagement(x => x
    .AddApplePush<PushConfigurationProvider>()
    .AddGooglePush<PushConfigurationProvider>()
);
  • Improve this Doc
In This Article
Back to top Generated by DocFX