Today I Learned How To Create Xamarin iOS and Android Unit Tests

I’m currently working on a notification plugin for Xamarin Forms and wanted to setup some unit tests.  The problem is my code accesses the device-specific notification systems in iOS and Android.  This means I can’t just run my unit tests on Windows.  Instead I need to run the unit tests in a iOS or Android environment.  In my case this means an emulator.

How to do that?  Use the NUnit 3 Xamarin Runners.  It was not clear how to correctly create the test projects but the way that worked for me was this.

[Read More]

Today I Learned How to Create a Local Notification in Xamarin Android

In Android you can schedule a notification that shows immediately using the NotificationManager.  However, if you are like me, awesome, and want to schedule a notification for a future date you need to use the Android AlarmManager.  The alarm manager lets you schedule an Intent to occur at a later date.

Quick aside, do you know what an Intent is in Android?  I kind of understand them but not as in-depth as I would like.  Please forgive any errors I make when I setup the alarm intent below.

[Read More]
Categories: goal-app today-i-learned 

Today I Learned Bait and Switch for .NET PCL's

If you have worked with Xamarin for longer than me (i.e. one year) then you probably already know about PCL bait and switch technique, especially if you consumed one of the many Xamarin plugins.

As usual I’m late to the party.  It’s November 2016 and the first article I found was written May 2014.  There is also a good video about the bait and switch technique for creating Xamarin plugins which I think was recorded in September 2014.  That said, I’m more an Early Adopter or Early Majority than an Innovator.

[Read More]
Categories: today-i-learned 

Today I Learned Xamarin Push Notification Plugins

I learned this week that there is no built-in support for Push Notifications in Xamarin Forms.  On the plus side there are several open source projects trying to fill this hole.  The one that has caught my eye is edsnider/Xamarin.Plugins.

It only supports local notifications but that is all I need right now.  I like it because it looks simple to use.  The only downside is it looks abandoned.  Hopefully I’ll get around to actually trying it this week.

[Read More]