Code Monkey home page Code Monkey logo

urbanairsharp's Introduction

UrbanAirSharp

UrbanAirSharp is a C# .Net library to simplify server-side calls to the Urban Airship API Version 3. http://docs.urbanairship.com/reference/api/v3/

Urban Airship unifies and simplifies the sending of push notifications to mobile devices. http://urbanairship.com/

API Support

The following API functionality is currently supported

  • Push
  • Validate
  • Schedule
  • Device Tokens
  • Tags

Support for the following still needs to be added

  • Feeds
  • Reports
  • Segments
  • Location

Getting Started

The source includes a test project which has examples on the supported functionality of the library

Using the library is very easy. Simply supply your UA keys and call Push

var client = new UrbanAirSharpGateway(AppKey, AppMasterSecret);

client.Push("Hey there - here's a Broadcast");

Here are some more examples of the supported functionality

client.Validate("Validate push", new List<DeviceType>() { DeviceType.Android }, "946fdc3d-0284-468f-a2f7-d007ed694907"); 

client.Push("Broadcast Alert");

client.Push("Broadcast Alert to Androids", new List<DeviceType>() { DeviceType.Android });

client.Push("Targeted Alert to device", new List<DeviceType>() { DeviceType.Android }, "946fdc3d-0284-468f-a2f7-d007ed694907");

This is an example of a more complicated, audience targeted Push

client.Push("Custom Alert per device type", null, null, new List<BaseAlert>()
{
	new AndroidAlert()
	{
		Alert = "Custom Android Alert",
		CollapseKey = "Collapse_Key",
		DelayWhileIdle = true,
		GcmTimeToLive = 5
	}
});

//these are just examples of tags
var rugbyFanAudience = new Audience(AudienceType.Tag, "Rugby Fan");
var footballFanAudience = new Audience(AudienceType.Tag, "Football Fan");
var notFootballFanAudience = new Audience().NotAudience(footballFanAudience);
var newZealandAudience = new Audience(AudienceType.Alias, "NZ");
var englishAudience = new Audience(AudienceType.Tag, "language_en");

var fansAudience = new Audience().OrAudience(new List<Audience>() { rugbyFanAudience, notFootballFanAudience });

var customAudience = new Audience().AndAudience(new List<Audience>() { fansAudience, newZealandAudience, englishAudience });

client.Push("English speaking New Zealand Rugby fans", null, null, null, customAudience);

License

Copyright (c) 2014-2015 Jeff Gosling Licensed under the MIT license.

http://opensource.org/licenses/mit-license.php

urbanairsharp's People

Contributors

bvandehey avatar emanueldejanu avatar grmartin avatar jeffgos avatar jnsv avatar theouteredge avatar

Watchers

 avatar  avatar

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.