Skip to content

KroneckerX/PushX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PushX

PushX PushX Build Status

3rd party push server structure written in C#.

Contents

Example

GCM Push Server:

1.Create class of your data structure implementing IData interface

    public class Foo : IData { }

2.Create a class implementing IGCM interface

    public class Fubar : IGCM

3.Create and instance and place your data to the box

    IGCM dataToSend = new Fubar();

4.Create server settings and server

    PushServerSettings settings = new PushServerSettings()
    {
        Server = "https://gcm-http.googleapis.com/gcm/send",
        DeviceGroup = "https://android.googleapis.com/gcm/notification",
        ProjectNumber = "{yourProjectNumber}"
    };
    
    GCMPushServer server = new GCMPushServer();
    server.SetApiKey({yourApiKey});
    server.SetSettings(settings);

4.Push your data

    string responseString = server.Send(dataToSend);

GCM Device Group:

    DeviceGroup deviceGroup = null;

Create

    deviceGroup = new DeviceGroup("FooGroupName",server); //server is an instance of GCMPushServer

Call Existing Group

    deviceGroup = new DeviceGroup({groupName},{groupKey},server);//server is an instance of GCMPushServer

Notice that, any existing device group does NOT include the data of its past registration ids creating above way.

Add New Devices

    public bool Add(RegistrationIdCollection collection)
    
    deviceGroup.Add(collection);

Remove Devices

    public bool Remove(RegistrationIdCollection collection)
    
    deviceGroup.Remove(collection)

Send

    public string Send(IData data)
    
    deviceGroup.Send(data);

About

Push message structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages