Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bithavoc/urbanairship-dot-net-client
UrbanAirship.com API Client for .NET
https://github.com/bithavoc/urbanairship-dot-net-client
Last synced: about 13 hours ago
JSON representation
UrbanAirship.com API Client for .NET
- Host: GitHub
- URL: https://github.com/bithavoc/urbanairship-dot-net-client
- Owner: bithavoc
- Created: 2012-01-12T22:18:33.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-09-17T18:43:05.000Z (about 10 years ago)
- Last Synced: 2023-04-10T03:12:39.923Z (over 1 year ago)
- Language: C#
- Homepage: bithavoc.io/urbanairship-dot-net-client
- Size: 232 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UrbanAirship .NET Client
This is an un-official [CLI](http://en.wikipedia.org/wiki/Common_Language_Infrastructure) client for the [UrbanAirship](http://urbanairship.com/) platform.
## Supported API
UrbanAirship supports many platforms including iOS, Android and RIM. However, this library only supports iOS at this time.Contributions are welcome.
## Usage
### Configuration
### Sending a Push Notification iOS
Client client = new Client(); // Uses Application Configuration File
client.iOS.RegisterDevice("Some Device Token");
PushNotification notification = client.CreatePush();
notification.iOS.Alert = "Hello World";
notification.DeviceTokens.Add("Some Device Token");
notification.Send();### Sending a Push Notification android
Client client = new Client(); // Uses Application Configuration File
client.GCM.RegisterDevice("Some Apid");
PushNotification notification = client.CreatePush();
notification.GCMPushDetails.Alert = "Hello World";
notification.GoogleApids.Add("Some Device Token");
notification.Send();### Sending a Push Notification cross plaftorm using alias
Client client = new Client(); // Uses Application Configuration File
client.GCM.RegisterDevice("Some google Apid", "[email protected]");
client.iOS.RegisterDevice("Some iOS Device Token", "[email protected]");
PushNotification notification = client.CreatePush();
notification.GoogleGCMDetails.Alert = "Hello World";
notification.iOS.Alert = "Hello World";
notification.Aliases.Add("[email protected]");
notification.Aliases.Add("[email protected]");
notification.Send();### Sending Custom Values
In order to send custom values as part of the notification, you need to create a sub class of PushNotification and decorate it with DataContract and DataMember attributes.
[DataContract]
class helloPush : PushNotification
{
[DataMember]
public string myCustomMessage
{
get;
set;
}
}Create an instance of the notification:
helloPush notification = client.CreatePush();
notification.myCustomMessage = "Hello There"## Contributors
* [Bithavoc (author)]([email protected])
* [Justin Hyland ]([email protected])## MIT License
Copyright (c) 2012, 2014 Bithavoc and Contributors - http://bithavoc.io
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.