Third-Party-Libraries and Frameworks

Sending Mobile Push notification using C#/.NET (iOS, Android, Windows Phone 8, Windows 8 and Blackberry)

August 9, 2013 .NET, ANDROID, Blackberry, Extensions, iOS, iPhone, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile, Mobile Services, Mobile-Development, Nokia, Third-Party-Libraries and Frameworks, VisualStudio, VS2010, VS2012, Windows, Windows 8 apps development, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, Windows SDK, Windows Store, Windows Store Development 2 comments

This is an update blog to my earlier blog about Sending Apple iOS Push notifications using C#.

With that blog – I  introduced you to  how to send push notification using Open Source library APNSharp, by the developer John Redth.  Redth announced that library is already deprecated.

Redth came up with  with another open source project called as PushSharp:,published under apache software foundation license.

PushSharp is a server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM – Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!. Single library serves the purpose of sending push notifications to multiple platforms. Pretty decent isn’t it?

Here is the basic  architecture:

image

Features of PUsHSHARP

  • Supports sending push notifications for many platforms:
    • Apple (APNS – iPhone, iPad, Mountain Lion)
    • Android (GCM/C2DM – Phones/Tablets)
    • Chrome (GCM)
    • Amazon (ADM – Amazon Device Messaging)
    • Windows Phone 7 / 7.5 / 8 (including FlipTile, CycleTile, and IconicTile Templates!)
    • Windows 8
    • Blackberry (BIS and BES via PAP)
    • Firefox OS (Coming soon)
  • Fluent API for constructing Notifications for each platform
  • Auto Scaling of notification channels (more workers/connections are added as demand increases, and scaled down as it decreases)

Implementation using PushSharp is straight forward

Here’s some sample code: shared by Redth

//Create our push services broker
var push = new PushBroker();

//Registering the Apple Service and sending an iOS Notification
var appleCert = File.ReadAllBytes("ApnsSandboxCert.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "pwd"));
push.QueueNotification(new AppleNotification()
                           .ForDeviceToken("DEVICE TOKEN HERE")
                           .WithAlert("Hello World!")
                           .WithBadge(7)
                           .WithSound("sound.caf"));


//Registering the GCM Service and sending an Android Notification
push.RegisterGcmService(new GcmPushChannelSettings("theauthorizationtokenhere"));
//Fluent construction of an Android GCM Notification
//IMPORTANT: For Android you MUST use your own RegistrationId here that gets generated within your Android app itself!
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId("DEVICE REGISTRATION ID HERE")
                      .WithJson("{"alert":"Hello World!","badge":7,"sound":"sound.caf"}"));

You can get the Push Sharp for your .NET projects from below mentioned links:

Binaries from NuGet: https://www.nuget.org/packages/PushSharp 

To install PushSharp, run the following command in the Package Manager Console

PM> Install-Package PushSharp

Source Code from GitHub: https://github.com/Redth/PushSharp

Documentation and Implementation Guides available at wiki page: https://github.com/Redth/PushSharp/wiki 

Quick links to implementation guides

You can read my previous blogs here:

Sending Apple iOS Push notifications using C#

Apple Push Notifications Service API & C#

Coding4Fun Toolkit v2.0.3 for Windows Phone and Windows 8 apps

March 21, 2013 .NET, .NET Framework, .NET Framework 4.5, Codeplex, Community, KnowledgeBase, Microsoft, MSDN, Third-Party-Libraries and Frameworks, ToolKits, VisualStudio, VS2010, VS2012, Windows 8, Windows 8 apps development, Windows Phone, Windows Phone 7.1 SDK, Windows Phone 7.5, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, Windows Store, Windows Store Development No comments

Coding4Fun team has released a new updates for their Windows Phone and Windows 8 controls. There are some interesting controls available for free through codeplex.com.

Coding4Fun team are major contributors to .NET community including Channel9 video series etc. They always brings up innovation in whatever they do, including set of Kinect based tutorials and sample codes available on Channel9 and Codeplex.

Here is the list of controls and converters available with this toolkit set provided to you by Coding4Fun Team.

Controls
Converters

The new release includes certain enhancements and bug fixes: (details given below)

New/Adjustments

  • PreventScrollBinding is included, this will prevents pivot / panorama movements on slider, prompts, …
  • Forced old nuget packages onto new system
  • Slider property change
    • Fill property -> Foreground property
    • Step property -> StepFrequency property

Bug Fixes

  • Toast Prompt would fail if you had two toasts active at the same time and swiped one away

You can download and try the latest release bits either through direct download from codeplex or through NuGet package installs.

Downloads:

Coding4Fun.Toolkit (Windows Phone 7).zip

Coding4Fun.Toolkit (Windows Phone 8).zip

Coding4Fun.Toolkit (Windows Store).zip

NuGet installs:

Documentation: http://coding4fun.codeplex.com/documentation