Skip to content

secondsun/aerogear-windows-push

 
 

Repository files navigation

aerogear-windows-push

Build status

Push client sdk to register with UPS and enable push notifications on windows phone Windows Phone 8 (Silverlight-based) and Windows Phone App 8.1 (WinRT-based)

Project Info
License: Apache License, Version 2.0
Build: Visual Studio
Documentation: https://aerogear.org/windows/
Issue tracker: https://issues.jboss.org/browse/AGWIN
Mailing lists: aerogear-users (subscribe)
aerogear-dev (subscribe)

Usage

Add the NuGet package to your project and add the following code:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    PushConfig pushConfig = new PushConfig() {
        UnifiedPushUri = new Uri(""), VariantId = "", VariantSecret = ""
    }; //[1]
    Registration registration = new Registration();      // [2]
    registration.PushReceivedEvent += HandleNotification;
    registration.Register(pushConfig);
}

void HandleNotification(object sender, PushReceivedEvent e)
{
    Debug.WriteLine(e.Args.message);
}
  • [1] add the url, variantId and varaintSecret of you Unified Push server
  • [2] When a project is wp8 mpns protocol is used for windows 8.1 and above it's wns.

or you can place a push-config.json file in the root of your project be sure to mark it as content with the following:

{
    "pushServerURL": "<pushServerURL e.g http(s)//host:port/context >",
    "variantID": "<variantID e.g. 1234456-234320>",
    "variantSecret": "<variantSecret e.g. 1234456-234320>"
}

This will be automatically be picked up by the registration:

Registration registration = new Registration();
registration.Register();

if you want to dynamically add categories or an alias you can combine the two above:

Registration registration = new Registration();
PushConfig config = registration.LoadConfigJson("push-config.json");
config.Categories = //user categories
registration.Register(config);

Building

Open project in Visual Studio and build.

Documentation

For more details about the current release, please consult our documentation.

Development

If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.

Also takes some time and skim the contributor guide

Questions?

Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!

Found a bug?

If you found a bug please create a ticket for us on Jira with some steps to reproduce it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 95.9%
  • Batchfile 4.1%