Giter Site home page Giter Site logo

shinyorg / shiny Goto Github PK

View Code? Open in Web Editor NEW
1.4K 50.0 226.0 31.84 MB

.NET Framework for Backgrounding & Device Hardware Services (iOS, Android, & Catalyst)

Home Page: https://shinylib.net

License: MIT License

PowerShell 0.01% C# 98.55% Shell 0.01% JavaScript 1.44%
xamarin ios android bluetoothle ble gps geofences notifications maui transfers

shiny's Introduction

Shiny v3 for .NET

Shiny is a cross platform framework designed to make working with device services and background processes easy, testable, and consistent while bringing things like dependency injection & logging in a structured way to your code!

Supports

  • Xamarin iOS
  • Xamarin Android
  • .NET 8 for Android
  • .NET 8 for iOS
  • .NET 8 for MacCatalyst

Features

  • Handles all of the cruft like Permissions, main thread traversal, persistent storage and app restarts
  • Brings your infrastructure to the background
  • Provides logging to ensure you know when your services fail in the background
  • Gives a clean & testable API surface for your code
  • Periodic Background Jobs
  • BLE Client & Hosting
  • Beacons Ranging & Monitoring
  • Locations - GPS & Geofencing
  • Push Notification - Native, Azure Notifications Hubs, Firebase, and more
  • Local Notifications - best of breed local notifications supporting almost all features across all of the supported platforms

Links

Visual Studio Templates

These templates will help get you up & running quickly. Simply select what features of Shiny you want to use and they will wire up everything from permissions to app configuration.

GitHub NuGet

dotnet new --install Shiny.Templates

Integrating With Existing Apps

If you cannot use our awesome templates - try our ugly, but effective boilerplate builder at: https://shinylib.net/client/appbuilder/

Support Shiny!

While Shiny is free and will continue to be so, maintenance and support takes a heavy toll on sustainability. If you or your company have the resources, please consider becoming a GitHub Sponsor. GitHub Sponsorships help to make Open Source Development more sustainable.

Depending on your Sponsorship Tier, you may also get access to some great benefits on Sponsor Connect (https://sponsorconnect.dev) including:

  • The Sponsor Only Discord server
  • Training available ONLY to sponsors on Sponsor Connect
  • Special sponsor-only packages

https://sponsor.shinylib.net

How about some Shiny Gear

Premium Paid Support

Looking for consulting for your .NET applications and Shiny, you can now book a time with Allan Ritchie on here: 1-1 Consulting Session

Contributors

Alt

Podcasting

For more info on Shiny and other great .NET content, listen to Jon Dick (aka Redth) and Allan Ritchie (Author of Shiny) every week at:

shiny's People

Contributors

aritchie avatar berhir avatar bruzkovsky avatar cburns-pw avatar cc3241 avatar codelisk avatar cpraehaus avatar dahlbyk avatar dansiegel avatar darshanio avatar dependabot-preview[bot] avatar dependabot[bot] avatar dministro avatar gw-fub avatar iustint avatar jamesmontemagno avatar jeremybp avatar justinjozzz avatar kevinhu-au avatar kolmado avatar kpespisa avatar matthieume avatar maxdev-dev avatar michalhoblik avatar msousley avatar olicooper avatar pellet avatar simoncropp avatar sschaub avatar thetownfool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shiny's Issues

WASM/Uno/Blazor

Summary

Support standard WASM .NET platform so Shiny can work with either Blazor or Uno.

API Changes

TBD

Intended Use Case

TBD

Update configuration API to support delegate methods

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

n/a

Version of Library

1.0.0.7-beta

Expected Behavior

Since we're following an ASP.NET Core startup pattern with IServiceCollection we should also follow the standard API configuration patterns by allowing a delegate method to configure the request rather than passing in a complete request.

public void ConfigureServices(IServiceCollection services)
{
    services.UseGps<BackgroudnGpsRunnerDelegate>(r => {
        r.UseBackground = true;
        r.DeferredTime = TimeSpan.FromSeconds(10);
    });
}

Actual Behavior

public void ConfigureServices(IServiceCollection services)
{
    var request = new GpsRequest { UseBackground = true, DeferredTime = TimeSpan.FromSeconds(3) };
    services.UseGps<BackgroudnGpsRunnerDelegate>(request);
}

Linux

Summary

Linux provides great support for IOT

API Changes

TBD

Intended Use Case

TBD

BluetoothLE Client (Refit Style)

Summary

Make a BLE client generate code similar to how refit generates HTTP client APIs

API Changes

TBD

Intended Use Case

More details to be provided via specification

[Bug] Invalid notification (no valid small icon), while sending notification

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.332-beta

Version of OS(s) listed above with issue

Android 9

Steps to Reproduce

  1. Send a notification, like notifications.Send("Hola", "Manolo");

Expected Behavior

Notification with title "Hola" and body "Manolo" appears.

Actual Behavior

Nothing appears on phone, and exception pops up with this details:

Java.Lang.IllegalArgumentException
 Message=Invalid notification (no valid small icon): Notification(channel=pluginnotificationId pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)

Bluetooth Classic

Summary

Use Bluetooth classic to connect to peripherals

API Changes

iOS 13 looks to support most (if not all) of the necessary functions for classic bluetooth. UWP & Android are already fully supported.

Intended Use Case

Provided

This should not be taken on by the community

[Bug] Geofence events not triggered on Android

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.264-beta

Version of OS(s) listed above with issue

9 (Pie)

Steps to Reproduce

  1. Setup Android for geofencing as per: https://allancritchie.net/posts/shiny-geofencing
  2. Alternatively use geofence sample here: https://github.com/shinyorg/shinysamples
  3. Run on emulator and change location or run on physical device and mock location

Expected Behavior

Geofence event triggered (in the example it displays a notification). I have verified that the notifications work in isolation to this issue.

Actual Behavior

No geofence event triggered.

Crash in iOS when sending notification with a payload set.

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

iOS 12.2

Version of Library

1.0.0.193

Expected Behavior

Payload can be set without crashing

Actual Behavior

Sending a notification with a payload leads to a crash:

|ERROR: Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<__NSDictionary0 0x600001c380d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Payload.

Meadow IOT

Summary

Meadow does have some very tight requirements in terms of API surface size. Until I have a board to test with, it is hard to determine if Shiny is a good fit for it.

API Changes

TBD

Intended Use Case

TBD

[BLE] Custom service on iOS is not available

Hello

First of all, congratulations for creating such an amazing library (including its awesome name) :)

I am trying to create a BLE Peripheral (Server) running on an Android/iOS phone, offering a custom service. A bluetooth enabled PC will act as a Central (Client) and consume the custom service.

It works very well on Android, but on iOS only advertising the service works.
Once I connect and list services the service is not listed (tried with my own client but also with some other bluetooth LE browsers).

What is a bit confusing me is this sentence is the documentation:

On iOS - you need to advertise as well as create a gatt server

What should I do beside adding the service (and its characteristics) and then starting advertising?

NOTE: The 'default' services which the iPhone offers are available (9 of them) and I can browse and read them. Only my custom one is not present.

Thank you in advance for any idea!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • [ X] iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • [ X] BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

iOS 12.3.1

Version of Library

1.0.0.238-beta

Expected Behavior

Offering a custom service via BLE should work on iOS.

Actual Behavior

Offering a custom service via BLE does not work. Advertising works, but the service is not found by the client.

[Bug] Android Geofence NullReferenceException

Platforms

  • Android

Feature Library

  • Locations

Version of Library

1.0.0.287-beta

Version of OS(s) listed above with issue

Android 6.0.1

Steps to Reproduce

Not sure honestly, just got a crash report. Presumably "have a geofence"?

Expected Behavior

No crash.

Actual Behavior

System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object)

System.NullReferenceException: Object reference not set to an instance of an object
  at Shiny.Locations.GeofenceManagerImpl.Process (Android.Content.Intent intent) [0x0003c] in <45153172f6dc477f9ba4a2b27bd23b41>:0 
  at Shiny.Locations.GeofenceBroadcastReceiver+<>c__DisplayClass1_0.<OnReceive>b__0 () [0x0009b] in <45153172f6dc477f9ba4a2b27bd23b41>:0

[Bug] Android 4.4 Job Scheduler Exception

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.307-beta

Version of OS(s) listed above with issue

v4.4 - KitKat
Should be any Android version with API level less than 21 - Lollipop

Steps to Reproduce

  1. Call AndroidShinyHost.Init on an Android device with Android 4.4

Expected Behavior

Shiny should initialize without any exceptions on Android 4.4.

Actual Behavior

A null reference exception is thrown in the Shiny.Jobs.ServiceExtensions class in StopJobService and StartJobService because the call to NativeScheduler returns null. According to this page, JobScheduler was introduced in API level 21.

image

Making the two changes in my screenshot below from the Shiny.Core > Jobs > Platforms > Android > ServiceExtension.cs file provided a workaround for me to avoid the exception.

image

HttpTransferRequest does not send file-content

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

v1.0.0.301-beta

Version of OS(s) listed above with issue

Irrelevant

Steps to Reproduce

  1. Create a HttpTransferRequest providing a file from Android local storage (Image from Gallery)
  2. Get the HttpTransferManager and Enqueue
  3. See the request complete without any Bytes transfered

Expected Behavior

The file gets transfered to my Webapi-Controller

Actual Behavior

The request gets sent, but the Content is empty.

macOS

Summary

Support macOS

API Changes

This is contigent on multitargeting in vs4mac due to mac support not be available on windows VS

Intended Use Case

TBD

iOS 13 Background Task

Summary

Use the iOS13 Background Task

API Changes

The iOS background task requires registering their individual namespace in the info.plist which is less than ideal. It does allow triggering based on charging & network state.

Intended Use Case

This is quite a bit better of a setup than background fetch.

This should not be taken on by the community

Wire Multiple Delegates to System Events

Summary

Ability to wire multiple delegates to system events (ie. geofence, gps, etc) and add them post service registration

API Changes

Must support state restoration per task (careful of reused types)

Intended Use Case

To be provided in specification

Error when building Xamarin.Forms iOS app on Azure DevOps using Shiny

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

v1.0.0.252-beta

Version of OS(s) listed above with issue

iOS 11.4
Xamarin Forms v4.1.0.555618
.NET Standard 2.0

Steps to Reproduce

  1. Setup Xamarin Forms app in Visual Studio 2019
  2. Add Shiny.Core and add call iOSShinyHost.Init to iOS project
  3. Setup pipeline in Azure DevOps

Expected Behavior

Build should finish successful as it does locally

Actual Behavior

Instead the linker fails:
Mono.Linker.LoadException: Error while processing references of 'Demo.iOS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Linker.LoadException: Error while processing references of 'Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Linker.LoadException: Error while processing references of 'Shiny.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

[Enhancement] Large file upload

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Summary

Please, add large file upload feature by introducing Multi-part Request at HttpClient.

API Changes

I reviewed sources and found that you may not use multipart request for file uploading with HttpClient. If right, large file upload must fail.

Please, add large file upload feature by introducing Multi-part Request at HttpClient.

Set Compass Heading to specific Location

Hi,

I'd like to ask is it possible to set compass heading to a specific location so it will always point ot that location? the location is a latitude and longitude for a religious place

How can I do that please for Xamarin Forms?

Thanks,
Jassim

ArguementException from ISettings

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

9.0

Version of Library

1.0.0.232-beta

Expected Behavior

This should work...

ISettings Settings { get; }

public bool? SomeProp
{
    get => Settings.Get<bool?>(nameof(SomeProp), null);
    set => Settings.Set<bool?>(nameof(SomeProp), value);
}

Actual Behavior

{
  "exception": {
    "type": "System.ArgumentException",
    "message": "Error setting key AppSettings_SessionClosedBecauseExpired with value ",
    "stackTrace": "  at Shiny.Settings.AbstractSettings.Set[T] (System.String key, T value) [0x0009f] in <3fe6d3a0fd09433b8c97d4497c8a96fc>:0 \n  at NCX.Mobile.Models.AppSettings.Set[T] (T value, System.String propertyName) [0x00011] in <4866ed2494c341cf8074a9d07e0ecae1>:0 \n  at NCX.Mobile.Models.AppSettings.set_SessionClosedBecauseExpired (System.Nullable`1[T] value) <0x87c68234 + 0x00027> in <4866ed2494c341cf8074a9d07e0ecae1>:0 \n  at NCX.Mobile.Services.Impl.NavigateToLogoutPageOnUserSessionChange.SaveStatesToSettings () <0x87d47f90 + 0x0007b> in <135bbd1557b54e6c9c163f58deb2e9cc>:0 \n  at NCX.Mobile.Services.Impl.NavigateToLogoutPageOnUserSessionChange.OnUserSessionClosed (System.Boolean reasonIsSessionExpired) <0x87d47bec + 0x00203> in <135bbd1557b54e6c9c163f58deb2e9cc>:0 \n  at NCX.Mobile.Services.Impl.UserService+<LogoutAsyncInternal>d__58.MoveNext () <0x87d86d4c + 0x00bf7> in <135bbd1557b54e6c9c163f58deb2e9cc>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at NCX.Mobile.Services.Impl.UserService+<LogoutAsync>d__53.MoveNext () <0x87d8527c + 0x0039f> in <135bbd1557b54e6c9c163f58deb2e9cc>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at NCX.Mobile.Services.Impl.UserLogoutCommand+<Logout>d__9.MoveNext () <0x87d83d98 + 0x00367> in <135bbd1557b54e6c9c163f58deb2e9cc>:0 ",
    "innerExceptions": [
      {
        "type": "System.NullReferenceException",
        "message": "Object reference not set to an instance of an object",
        "stackTrace": "  at Shiny.Settings.SettingsImpl+<>c__DisplayClass6_0.<NativeSet>b__0 (Android.Content.ISharedPreferencesEditor x) <0x87515214 + 0x00028> in <3fe6d3a0fd09433b8c97d4497c8a96fc>:0 \n  at Shiny.Settings.SettingsImpl.UoW (System.Action`1[T] doWork) <0x87521f48 + 0x000a3> in <3fe6d3a0fd09433b8c97d4497c8a96fc>:0 \n  at Shiny.Settings.SettingsImpl.NativeSet (System.Type type, System.String key, System.Object value) <0x8750b8e8 + 0x000d7> in <3fe6d3a0fd09433b8c97d4497c8a96fc>:0 \n  at Shiny.Settings.AbstractSettings.Set[T] (System.String key, T value) [0x00064] in <3fe6d3a0fd09433b8c97d4497c8a96fc>:0 ",
        "wrapperSdkName": "appcenter.xamarin"
      }
    ],
    "wrapperSdkName": "appcenter.xamarin"
  },
  "properties": {
    "exception": "System.ArgumentException: Error setting key AppSettings_SessionClosedBecauseExpired with value  ---> System.NullReferenceExce"
  },
}

GitHub Sponsor Patreon link not working

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

Version of Library

Expected Behavior

Actual Behavior

GitHub Sponsor Patreon link not working

AndroidShinyHost and iOsShinyHost not available

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

Version of Library

1.0.0.187 and 1.0.0.0.8 (check only those two)

Expected Behavior

AndroidShinyHost and iOsShinyHost are included in the Nuget Shiny.Core

Actual Behavior

Both classes are not available and I don't know why. Am I missing a nuget package?

[Bug] [iOS] BLE Peripheral - Notification broadcasts not working

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • [ x] iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • [ x] BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.253-beta

Version of OS(s) listed above with issue

iOS 12.3.1

Steps to Reproduce

  1. Start the ShinySamples
  2. Start some client which subscribes to notifications
  3. Put a breakpoint at the line where the .Notify is called.

Expected Behavior

Notify is executed and the app moves on.

Actual Behavior

Execution hangs inside the Notify method

I am not sure, but isn't it that the tcs is never 'completed' ? The tcs.SetResult seems to be missing:

public async Task Notify(byte[] data, params IPeripheral[] centrals)
        {
            var tcs = new TaskCompletionSource<object>();
            var handler = new EventHandler((sender, args) =>
            {
                this.manager.UpdateValue(
                    NSData.FromArray(data),
                    this.native,
                    null
                );
            });
            this.manager.ReadyToUpdateSubscribers += handler;

            await tcs.Task.ConfigureAwait(false);
            this.manager.ReadyToUpdateSubscribers -= handler;
        }

Beacon Advertising

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Summary

Add Beacon Advertising as part of the Shiny.Beacons library

API Changes

There will be background issues with iOS on this.

Intended Use Case

TBD

This task is definitely not guaranteed and is here for logging purposes.

Set Compass Heading to specific Location

Hi,

I'd like to ask is it possible to set compass heading to a specific location so it will always point ot that location? the location is a latitude and longitude for a religious place

How can I do that please for Xamarin Forms?

Thanks,
Jassim

AndroidX Work Manager

Summary

Use AndroidX WorkManager

API Changes

Currently, the job manager from the support library is used.

Blocker

The work manager is currently not based on promises and should not be used until it is.

Intended Use Case

Replace support library with AndroidX

This should not be taken on by the community

Job Triggers

Summary

Currently, jobs are only triggered periodically. The ability to trigger off network state changes, charging state changes, etc leads to a much more reactive system.

API Changes

Android work manager & job manager already support this but are currently being used in a non-efficient way by shiny (1 job, manages all shiny jobs). The problem with this is triggers. iOS 13 now supports background tasks with some triggers (device charging & network).
UWP already had triggers

Intended Use Case

Covered

This should not be taken on by the community

Geofencing RegionStatusChanged event not triggered after restart app?

Thank you for you great Plugin!
I have successful create geofence and event "RegionStatusChanged" working good.
But after restart the app, "RegionStatusChanged" not triggered any more.
I have get "MonitoredRegions" list. My position still in there.
Please help me when you have free time!
Thank!

[Bug] Background job UWP not triggered?

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core (Jobs)
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

V1.0.0.264-beta

Version of OS(s) listed above with issue

Windows 10

Steps to Reproduce

No steps

Expected Behavior

Background job to run once every X minutes

Actual Behavior

Background job never called by system

Should the implementation of jobs for UWP work at the moment or is there still work to be done? We played around with the background jobs for a while but haven't seen the UWP background job run. Saw some TODO comments in the code so was curious if the current implementation actually works for UWP.

Thanks! Like the framework.

Use Async name for async APIs

Description

Several API's within Shiny such as IJobManager.Schedule or IJobManager.Run look like they are synchronous when they actually operate asynchronously. This can lead to confusion where you might think you can initialize your jobs like:

manager.Schedule(someJob);
manager.Run("someJob");

However with them being async methods it is possible that the job may not be scheduled when Run is called. Adopting a Async suffix for async API's would be helpful to developers as it would be self evident that it's async.

await manager.ScheduleAsync(someJob);
await manager.Run("someJob");

Version of Library

  • 1.0.0.2-beta

[Bug] Adding Shiny Core to Existing Project

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.334-beta

Version of OS(s) listed above with issue

iOS 9+
Android 6+

Steps to Reproduce

  1. Have existing Visual Studio 2019 for Mac cross platform project for iOS and Android
  2. Add Shiny NuGet package for BluetoothLE
  3. Add example AndroidShinyHost.Init call from getting started
  4. Create MyDelegateClass from getting started
  5. Add services.UseBleCentral() to MyStarted Class from getting started
  6. Note that there is an error the UseBleCentral doesn't exist. Checked all references and they seem to be there
  7. Note that there is an error in thee Android project that AndroidShinyHost doesn't exist

Expected Behavior

I downloaded the samples github repo and they all seem to be defined. When I look in the Object Browser in the samples projects Shiny.Core has a lot more classes than when I look at it in mine and yet the nuget references look the same.

Actual Behavior

missing classes and extension methods.

Connection to BLE devices

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

Android 8.0(Nexsus 5X)

Version of Library

1.0.0.193-beta

Expected Behavior

Fast connection to BLE device

Actual Behavior

Library very fast found the device, but the peripheral.Connect() is too slow(sometimes for about half a minute)

Preferred Periodic Time for Jobs

Summary

Currently, periodic times are set to the minimums for each operating system. The ability to control this would be ideal with a setting/constant to provide minimum value of periodic.

API Changes

This requires work done in #47, #48, & #49

Intended Use Case

Provided

This should not be taken on by the community

[Android] GpsManager.IsListening is stuck

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • [x ] Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • [ x] Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

All

Version of Library

1.0.0.3-beta

Expected Behavior

GpsManager.IsListening is set to true always after being started

Actual Behavior

Only listening when it should be

[Bug] Android Geofence NullReferenceException

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.268-beta

Version of OS(s) listed above with issue

9

Steps to Reproduce

  1. Create Geofence with ShinySample

Expected Behavior

Successful notification.

Actual Behavior

Screenshot_20190715-223255
(A copy error button in the sample would be handy!)

IsConnectable Issue

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

Version of Library

1.0.0.172

Expected Behavior

Not to crash

Actual Behavior

Crash

I checked Bluetooth LE in Shiny and figured out that if you try to use IsConnectable property you have a crash on Android 7-. So, it would be better if the library can handle it.
Also, users need to spend time to realize the root cause. I Found a comment in the source code that this property supported only in Android 8+
https://github.com/shinyorg/shiny/blob/1d8d4f97b961a6e5b42105df7678adf6ea95f747/src/Shiny.BluetoothLE/Central/Platforms/Android/AdvertisementData.cs
It would be better to have the description in order to be able to see that this property supported only for several android versions.

Resolving IGeofenceManager in Geofence Delegate causes crash

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • [x ] Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • [x ] Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.264-beta

Version of OS(s) listed above with issue

Android 8

Steps to Reproduce

  1. Enable Geofence in Startup class
  2. Create a BackgroundJob
    3.Try to Resolve IGeofenceManager

Expected Behavior

Should resolve to Singleton instance of IGeofenceManager

Actual Behavior

Application crashes

Stacktrace.txt

[Bug] ProGuard issue while loading JobManager

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.306-beta

Version of OS(s) listed above with issue

Android Nougat
macOS 10.14.5

Steps to Reproduce

  1. Use the JobManager
  2. Enable proguard
  3. Run a release build

Expected Behavior

The app should run

Actual Behavior

The app crashes with the following stacktrace:

[AndroidRuntime] android.runtime.JavaProxyThrowable: System.InvalidOperationException: A suitable constructor for type 'Shiny.Jobs.JobManager' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite (System.Type serviceType, System.Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) <0x70949479bc + 0x00604> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact (Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor, System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) <0x7094947654 + 0x000f7> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) <0x7094947198 + 0x0006b> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) <0x709494e910 + 0x000d3> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor (System.Type serviceType) <0x709494bae0 + 0x00057> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) <0x709667cf98 + 0x000b7> in <3361a83b4b6d4cc080edaa4305dde75a>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope serviceProviderEngineScope) <0x709494ba48 + 0x0004f> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService (System.Type serviceType) <0x709494b9c8 + 0x00037> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) <0x70949465f4 + 0x0003f> in <fb52042823624ebebed2e179ffd81a72>:0 
[AndroidRuntime]   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T] (System.IServiceProvider provider) <0x7094987c38 + 0x0004b> in <030cd78051ca465b832cd0396110c776>:0 
[AndroidRuntime]   at Shiny.ShinyHost.Resolve[T] () <0x70940e3374 + 0x00043> in <7edbfa27e30b4fa49e15e63d72961701>:0 
[AndroidRuntime]   at MyTV.Core.IoCRegistry.RegisterUtils (Autofac.ContainerBuilder builder) <0x709468a534 + 0x0028b> in <50a8c70db1cd4b7e829bf4b707904c10>:0 
[AndroidRuntime]   at MyTV.Core.IoCRegistry.RegisterCore (Autofac.ContainerBuilder builder, System.Collections.Generic.IEnumerable`1[T] additionalProfiles) <0x7094689d00 + 0x0006f> in <50a8c70db1cd4b7e829bf4b707904c10>:0 
[AndroidRuntime]   at MyTV.Droid.Setup.CreateIocProvider () <0x7092fb5ae0 + 0x00057> in <3bb21387111146fbbbc508cd947328f1>:0 
[AndroidRuntime]   at MvvmCross.Core.MvxSetup.InitializeIoC () <0x709566fc2c + 0x00033> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Core.MvxSetup.InitializePrimary () <0x709566f3cc + 0x00047> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Core.MvxSetupSingleton.StartSetupInitialization () <0x7095672014 + 0x00053> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Core.MvxSetupSingleton.EnsureInitialized () <0x7095671c10 + 0x000cb> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Platforms.Android.Views.MvxActivityViewExtensions.EnsureSetupInitialized (MvvmCross.Platforms.Android.Views.IMvxAndroidView androidView) <0x709563fb70 + 0x0008f> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Platforms.Android.Views.MvxActivityViewExtensions.OnViewCreate (MvvmCross.Platforms.Android.Views.IMvxAndroidView androidView, Android.OS.Bundle bundle) <0x709563f1cc + 0x00073> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Platforms.Android.Views.MvxActivityAdapter.EventSourceOnCreateCalled (System.Object sender, MvvmCross.Base.MvxValueEventArgs`1[T] eventArgs) <0x709563ec28 + 0x000a3> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at (wrapper delegate-invoke) System.EventHandler`1[MvvmCross.Base.MvxValueEventArgs`1[Android.OS.Bundle]].invoke_void_object_TEventArgs(object,MvvmCross.Base.MvxValueEventArgs`1<Android.OS.Bundle>)
[AndroidRuntime]   at MvvmCross.Base.MvxDelegateExtensions.Raise[T] (System.EventHandler`1[TEventArgs] eventHandler, System.Object sender, T value) <0x709569379c + 0x00067> in <4562264c3faf4096ab0448a5898edfdf>:0 
[AndroidRuntime]   at MvvmCross.Droid.Support.V7.AppCompat.EventSource.MvxEventSourceAppCompatActivity.OnCreate (Android.OS.Bundle bundle) <0x70947d35a4 + 0x0005f> in <9874589629f845c7b92ca47830098dae>:0 
[AndroidRuntime]   at MvvmCross.Droid.Support.V7.AppCompat.MvxAppCompatActivity.OnCreate (Android.OS.Bundle bundle) <0x70947c4590 + 0x00033> in <9874589629f845c7b92ca47830098dae>:0 
[AndroidRuntime]   at MyTV.Droid.Views.BaseActivity`1[TViewModel].OnCreate (Android.OS.Bundle bundle) <0x7092fb5bdc + 0x00037> in <3bb21387111146fbbbc508cd947328f1>:0 
[AndroidRuntime]   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) <0x70960ed740 + 0x0006f> in <b297454edca84df9b51feeff14951c94>:0 
[AndroidRuntime]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.19(intptr,intptr,intptr)
[AndroidRuntime] 	at md51956971b8a87a8f55af6e317984e9bb2.BaseActivity_1.n_onCreate(Native Method)
[AndroidRuntime] 	at md51956971b8a87a8f55af6e317984e9bb2.BaseActivity_1.onCreate(BaseActivity_1.java:30)
[AndroidRuntime] 	at android.app.Activity.performCreate(Activity.java:7144)
[AndroidRuntime] 	at android.app.Activity.performCreate(Activity.java:7135)
[AndroidRuntime] 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
[AndroidRuntime] 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
[AndroidRuntime] 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
[AndroidRuntime] 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
[AndroidRuntime] 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[AndroidRuntime] 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[AndroidRuntime] 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
[AndroidRuntime] 	at android.os.Handler.dispatchMessage(Handler.java:106)
[AndroidRuntime] 	at android.os.Looper.loop(Looper.java:193)
[AndroidRuntime] 	at android.app.ActivityThread.main(ActivityThread.java:6718)
[AndroidRuntime] 	at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
[Process] Sending signal. PID: 27091 SIG: 9

[Enhancement] StartupTask as async

Summary

Any reason why there's no StartAsync in IStartupTask? Or maybe an additional IStartupAsyncTask ?

API Changes

IStartupTask.StartAsync or additional IStartupAsyncTask with StartAsync

Intended Use Case

Some startup tasks can be async.

BluetoothLE

Summary

BLE is such a large scope of work - this just needs to get done.

API Changes

None

Intended Use Case

Continued efforts on bringing Tizen into Shiny

[Bug] Shiny.Testing is inconsistent

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard
  • .NET Core App (Testing)

Feature Library

  • Core
  • BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

1.0.0.280-beta

Version of OS(s) listed above with issue

netcoreapp3.0

Steps to Reproduce

  1. Create a Unit Test Project
  2. Install Shiny.Testing
  3. Write test to validate that your delegates are registered with the container

Expected Behavior

  1. Expected IShinyStartup in the ShinyTestHost
  2. Expected IGpsDelegate to be Registered
  3. Expected IGeofenceDelegate to be Registered
  4. Expected IBeaconDelegate to be Registered
  5. Expected IBleAdapterDelegate to be Registered
  6. Expected TestGpsManager to be Registered
  7. Expected TestGeofenceManager to be Registered
  8. Expected some sort of something to be Registered for BLE
  9. Expected some sort of something to be Registered for Beacons

The first issue is stupid simple to fix... the next 4 on the Delegates it would just be good to have some sort of consistency... as for the last few... I might propose that the ShinyTestHost does something like:

public static void Init(IShinyStartup startup, Action<IServiceCollection> platformBuild = null)
{
    Shiny.Locations.ServiceCollectionExtensions.RegisterGpsPlatform = s => s.AddSingleton<IGpsManager, TestGpsManager>();
    Shiny.Locations.ServiceCollectionExtensions.RegisterGeofencePlatform = s => s.AddSingleton<IGeofenceManager, TestGeofenceManager>();

    InitPlatform(startup, services =>
    {
        // no changes
    });
}

This would allow you to update the behavior in the registration calls for the netstandard target so that if the Register action has been set you can invoke it and return true instead of always return false.

Actual Behavior

  1. ShinyTestHost requires something that inherits from ShinyStartup not it's root interface IShinyStartup
  2. IGpsDelegate is never registered as the base call to UseGps is called first and always returns false for netstandard/netcoreapp
  3. IGeofenceDelegate is registered... as the delegate is registered before we do any sort of checks to return false in the registration extension.
  4. IBeaconDelegate is never registered. Like the GpsDelegate, we check the root registration (Use Beacons) first thereby never getting to the AddSingleton for the Delegate
  5. IBleAdapterDelegate is registered... In this case the Shiny registration extension is a simple wrapper for services.AddSingleton thereby allowing the delegate to be registered...
  6. TestGpsManager is not registered as it seems there's no hook to get this automatically as part of the UseGps
  7. TestGeofenceManager is not registered for the same reason as the GpsManager
  8. Upon further examination of the registration call for the BleAdapterDelegate it makes sense nothing more would be registered here...
  9. It seems there are no mocks in place in general for the Beacons yet.

[Bug] BluetoothAdapter.ActionStateChanged does not work anymore (API 26)

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • Android
  • UWP
  • watchOS
  • tvOS
  • Tizen
  • .NET Standard

Feature Library

  • Core
  • [ X] BluetoothLE
  • Beacons
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of Library

independent

Version of OS(s) listed above with issue

Starting with Android 8.0 (API 26)

Steps to Reproduce

  1. Try to use the .WhenStatusChanged method

Expected Behavior

When switching Bluetooth On and Off on the phone, the handler should be called.

Actual Behavior

The handler is not called at all.

For details see: Documentation

I found no alternative to this yet :(

[Enhancement] Shiny Sample for default Xamarin Forms MVVM instead Prism & RX

Summary

Please, add Shiny Sample for default Xamarin Forms MVVM instead Prism & RX

API Changes

Recent XF is not bad without external MVVM framework like MVVMLight or Prism.
So, many developers use default visual studio template of Xamarin Forms.

Intended Use Case

Shiny Sample which Prism & RX framework are not used.

[BLE] Subscription/Notification does not work

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • iOS
  • [ X] Android
  • UWP
  • .NET Standard

Feature Library

  • Core
  • [ X] BluetoothLE
  • Locations
  • HTTP Transfers
  • Notifications
  • Sensors

Version of OS(s) listed above with issue

Android 8.0

Version of Library

1.0.0.244-beta

Expected Behavior

Subscribing to notifications should work.

Actual Behavior

None of the 3 GATT clients I've tried is able to subscribe to the "notifiable" characteristics offered by a Shiny GATT server.

The problem is reproducible with the latest Shiny-Samples project too (I saw there are notifications there too).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.