Just wanted to throw this out there for everyone. I took the objective-c iOS implementation and translated it to C# using HttpClient backed with ModernHttpClient. There is a working Xamarin.Forms sample included in the project to show how you can use it. The SDK is 99% complete, I haven’t taken the time to figure out two methods on the ParticleCloud
class: SignUpWithCustomerAsync
and RequestPasswordResetForCustomerAsync
. In the future I will extend the Xamarin.Forms sample to include a Windows 10 app. I haven’t tested Windows, but I’m sure it all works fine since it is housed in a Portable Class Library.
I tested the SDK on both Xamarin.iOS and Xamarin.Android, but I can obviously only test it out so much. That’s where you come in! If you use it and something doesn’t work as expected, open up an issue and I’ll take a look. I tried to design the SDK in a way that would be lightweight, 100% asynchronous and utilizes IDisposable
as much as I could.
Also, I just finished Events this weekend. Errors on the subscribed events will not invoke OnStart or OnError unless you manually wire it up. I did this for performance reasons. Unsubscribed events will return the cached data and dispose of everything else. I also left the option open to be able to manually construct EventSource, wire it up however you need, start it and then add it to the ParticleCloud
SubscibedEvents
if you want to.
It is important to also note that the Event Subscription setup will throw a HttpClient on a new thread. I was able to subscribe to two events fine, but I’m sure at some point you will feel the performance drag. So don’t subscribe to 10 events. If you need that, fork my implementation and make your own TaskFactory to better manage those events however you need.
Stop talking and give us the link!!!
If you have any questions about cross-platform mobile apps working with Particle, send me a private message and we can talk. I will also be the only person maintaining this repo, but I’m always happy to look at pull requests or any suggestions people have. I love Particle and what they have done. I started this project because I wanted to build a motorcycle tracker with the Electron. Now maybe I’ll have some time to finish that with this completed SDK!