»  WINDOWS PHONE »  Native Windows Phone SDK

Native Windows Phone SDK

Native windows phone sdk has never been so easy! Our extensive guides for all platforms currently available on the market show how to integrate push notifications within several minutes and with several lines of code. You can choose between native programming tools and a diverse set of cross-platform solutions. We are working hard on extending the list of supported SDKs, plugins and modules, so we advise coming back once in a while to see what's new. If you believe that some great tools should be added here, please let us know, and we will do our best to get them up and running!

 

SDK Integration

SDK comes with the full source and a Sample Project. You can use an emulator while working with push notifications.

In order to integrate BulkPush into your application, follow the steps below.

 

1. Download our SDK package. If you develop for Windows Phone 8, add reference to BulkPushSDK/SDKBuild/WP8/ BulkPushSDK.dll to your project.

2. In the code add the BulkPushSDK namespace: using BulkPushSDK;

3. Initialize push service with the following code:

 

_service = NotificationService.GetCurrent("3A43A-A3EAB",null, null);
 
            _service.OnPushTokenReceived += (sender, args) =>
            {
            };
 
            _service.OnPushTokenFailed += (sender, args) =>
            {
            };
 
            _service.OnPushAccepted += (sender, args) =>
            {
               
            };
            _service.SubscribeToPushService();

 

First parameter – identifier of your application in BulkPush(required);

Second parameter – the name of the service for authenticated pushes, pass null if you don’t have one set-up;

Third parameter – a list of the trusted servers that could send Tile notifications (required for receiving Tile notifications).

 

4.Make sure you have enabled ID_CAP_PUSH_NOTIFICATION and ID_CAP_IDENTITY_DEVICE capabilities in your project. Expand the Properties folder in your Windows Phone application project and open WMAppManifiest.xml file.

You should enable ID_CAP_PUSH_NOTIFICATION and ID_CAP_IDENTITY_DEVICE capabilities by checking the corresponding checkbox.

That’s it! Easy, isn’t it?

 

Advanced features

 

Tags

Tags allow you to create a set of devices based on different criteria.

1. Create a list of tags:

 

var tagsList = new List>();
  

 

2. Add a tag to the list:

 

tagsList.Add(new KeyValuePair(“testKey”,“testValue”));

 

3. Get the instance of NotificationService and send tags:

 

NotificationService service = NotificationService.GetCurrent();
 
_service.SendTag(tagsList,
   (obj, args) =>
   {
    MessageBox.Show("Tag has been sent!");
   },
   (obj, args) => MessageBox.Show("Error while sending the tags: \n" +
 
args.ToString())
 );

 

 

User Data

The application user can send any custom data to BulkPush with the custom tag.

 

1. Get the instance of NotificationService and get user data with the push notification (it also comes in the push notifications payload by the way!)

 

Geo zones

You can send push notifications to users located in a specific area.

1. Expand the Properties folder in your Windows Phone application project and open WMAppManifiest.xml file.

 

Enable ID_CAP_LOCATION capability by checking the respective checkbox. Thus, the application will be able to use the device location for the GeoZones feature.

 


  
   // Enable this
 
capability to use geolocation s ervices
  
  
  
  

 

2. Turning Geo Zones on :

 

NotificationService service = NotificationService.GetCurrent();
service.StartGeoLocation();

 

3. Turning Geo Zones off :

 

NotificationService service = NotificationService.GetCurrent();
service.StopGeoLocation();

 

© 2015 BulkPush.com By Broadnet Technologies Ltd.