3.0 ALPHA
Important
This is an ALPHA release! There are still changes planned! We are not taking bugs on things at this time. Hosting has vastly changed in our model to support MAUI, WebAssembly, and other future platforms we intend to support
Generators have been removed temporarily. It has not been decided how/if we will support them in the future.
We now support the following platforms:
- .NET 7 - only for abstractions
- .NET 7 for iOS
- .NET 7 for MacCatalyst
- .NET 7 for Android
- .NET Standard 2.1 only for abstractions
- Xamarin iOS
- Xamarin Android
- COMING SOON: WebAssembly
Note
Shiny.Extensions.Configuration (Xamarin version of Microsoft.Extensions.Configuration) is now part of this repository
MAUI
- Shiny.Hosting.Maui initial integration package created (Example how to setup shown below)
WebAssembly (Core)
- Initial settings library built on top of local storage
- Connectivity service
- Battery service
Core
- [BREAKING] IShinyStartup is gone - we now have a new HostBuilder pattern to allow classic to align with MAUI/NET6. Use extensions methods to build on this for classic/non-MAUI setups
- [BREAKING] IShinyModule is gone - use extensions methods instead
- [Enhancement] IShinyStartupTask and INotifyPropertyChanged persistent services are now registered using the service collection extension .AddShinyService during your bootstrapping
- [Enhancement] New hosting model that is meant to carry Shiny forward to other platforms and improve on the original ShinyHost model
- [Enhancement] New internal lifecycle processor
- [Enhancement] Any Shiny library that uses an Android foreground service (Beacon Monitoring, GPS, HTTP Transfers) now has a new mechanism that allows for FULL control over the persistent notification
Configuration
- Configuration is now part of the core library
- [Enhancement] Now loads platform specific json assets like appsettings.android.json, appsettings.ios.json, appsettings.maccatalyst.json, & appsettings.apple.json
Notifications
- [Enhancement][Android] Android 13 Support for new POST_NOTIFICATION permissions
- [Enhancement] OS specific configuration for Android & iOS
- [Enhancement] Ability to customize actual native notification before it is sent/queued
- [Enhancement] Improved sound customization via new channel flag - Channel.Sound = ChannelSound.Custom|High|Default|None
Push
- [Enhancement][Android] Android 13 Support for new POST_NOTIFICATION permissions
- [Enhancement] Now works on new xplat lifecycle management from Core
- [Enhancement] Internally rewritten to make architecture easier going forward - firebase, azure, etc all become plugins on top of native instead of full implementations
Locations
- [Enhancement][Apple] You can now control location manager properties like ActivityType & ShowsBackgroundLocationIndicator via AppleLocationConfiguration service
- [Enhancement][Android] To configure the foreground service notification, your IGpsDelegate can also implement IAndroidForegroundServiceDelegate with #if ANDROID preprocessor directives
BluetoothLE
- [Enhancement] L2Cap supported
- [Enhancement][Android] RequestAccess(bool connect) now allows you to additionally request access to GATT connections (defaults to true). This allows Shiny to use Android API 31 properly. It will always ask for scan permissions.
- [BREAKING][Android] Adapter control is no longer support through the Shiny API, but you do have raw access to the native adapter if needed
- [BREAKING] Managed scan now require you to set scan configuration values in Start instead of the constructor & property setters
BluetoothLE Hosting
- [Enhancement][Android] RequestAccess now exists - you can specifically target your permissions to take advantage of Android API 31
- [Enhancement] L2Cap supported
- [Enhancement] All characteristic hooks are now async
- [Enhancement] New "managed" model
- [Enhancement] Advertise iBeacons is now supported - it exists here instead of Shiny.Beacons because all of the advertising code is here
HTTP Transfers
- [Enhancement] Rewritten API makes it easier than ever to monitor metrics of your transfers
- [Enhancement][Android] Now supports persistent progress notifications
- [Enhancement] Downloads now support pause & resume of transfers
Beacons
- [Enhancement][Android] To configure the foreground service notification on beacon monitoring, your IBeaconMonitorDelegate can also implement IAndroidForegroundServiceDelegate with #if ANDROID preprocessor directives
Jobs
- [BREAKING][iOS] We no longer support the background fetch style (old) job management - only bgtasks will be used going forward
Libraries that will not move to v3
- Shiny.NFC
- Shiny.Sensors
MAUI Setup
- Install Shiny.Hosting.Maui
- Install the nuget package(s) shown above each comment below to get that functionality
- Ensure you add UseShiny as shown below
using Shiny;
namespace Sample;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp
.CreateBuilder()
.UseMauiApp<App>()
// THIS IS REQUIRED TO BE DONE FOR SHINY TO RUN
.UseShiny();
// shiny.locations
builder.Services.AddGps<SampleGpsDelegate>();
builder.Services.AddGeofencing<SampleGeofenceDelegate>();
builder.Services.AddMotionActivity();
// shiny.notifications
builder.Services.AddNotifications<SampleNotificationDelegate>();
// shiny.bluetoothle
builder.Services.AddBluetoothLE<SampleBleDelegate>();
// shiny.bluetoothle.hosting
builder.Services.AddBluetoothLeHosting();
// shiny.beacons
builder.Services.AddBeaconRanging();
builder.Services.AddBeaconMonitoring<SampleBeaconMonitorDelegate>();
// shiny.net.http
builder.Services.AddHttpTransfers<SampleHttpTransferDelegate>();
// shiny.speechrecognition
builder.Services.AddSpeechRecognition();
// shiny.push
builder.Services.AddPush<SamplePushDelegate>();
// shiny.jobs
builder.Services.AddJob(typeof(SampleJob));
builder.Services.AddJobs(); // not required if using above
// shiny.core - startup task & persistent service registration
builder.Services.AddShinyService<StartupTask>();
// shiny.push
builder.Services.AddPush<SamplePushDelegate>();
// or shiny.push.firebasemessaging
builder.Services.AddPushFirebaseMessaging<SamplePushDelegate>();
// or shiny.push.azurenotificationhubs
builder.Services.AddPushAzureNotificationHubs<SamplePushDelegate>();
return builder.Build();
}
}
New Android Foreground Service Notification Customization
// ex. this is using a GPS background delegate
public class MyGpsDelegate : Shiny.Locations.IGpsDelegate
#if ANDROID
, Shiny.Locations.IAndroidForegroundServiceDelegate
#endif
{
// .. implementation details left out for brevity
#if ANDROID
public void Configure(Android.NotificationCompat.Builder builder)
{
var builder = new NotificationCompat.Builder(this.Context, "gps");
builder.SetContentTitle("GPS");
builder.SetContentText("GPS is running in the background");
builder.SetSmallIcon(Resource.Drawable.ic_launcher_foreground);
builder.SetPriority((int)NotificationCompat.PriorityHigh);
builder.SetCategory(NotificationCompat.CategoryService);
}
#endif
}