»  ANDROID »  Android Additional Platforms »   Appcelerator Titanium

Appcelerator Titanium

Appcelerator titanium 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!

Integration

 

To integrate BulkPush into your Appcelerator Titanium Android application you need to do simple following steps:
Download the Android Push Notifications Module and put it in your Modules folder: https://github.com/BulkPush/BulkPush-sdk-samples/tree/master/Appcelerator-Titanium/Push-Notifications-Module/Android-Module
Don’t forget to enable this module in tiapp.xml as per Appcelerator guide.

 

 

Usage

 

var pushnotifications = require('com.arellomobile.bulkpush');
Ti.API.info("module is => " + pushnotifications);
     
pushnotifications.pushNotificationsRegister("GOOGLE_PROJECT_ID",   
 "BULKPUSH_APP_ID", {
//NOTE: all the functions fire on the background thread,
//do not use any UI or  Alerts here
success:function(e)
{
   Ti.API.info('JS registration success event: ' + e.registrationId);
},
error:function(e)
{
   Ti.API.error("Error during registration: "+e.error);
},
callback:function(e)
 // called when a push notification is received
{
   Ti.API.info('JS message event: ' + JSON.stringify(e.data));
}
});

 

 

Geolocation

 

If you would like to use Geo Push Notifications add the following service to your manifest file:

 




 

Android Push Notifications Module API:

 

//Registers for android push notifications and provides
//push notification handler function (callback)
 
 
  pushnotifications.pushNotificationsRegister("GOOGLE_PROJECT_ID",
  "BULKPUSH_APP_ID", {success, error, callback});
 
   //Unregisters from push notifications
  pushnotifications.unregister();
 
  //Start tracking GeoPushes
  pushnotifications.startTrackingGeoPushes();
 
  //Stop tracking GeoPushes
  pushnotifications.stopTrackingGeoPushes();
 
  //Sets tags for the device
  pushnotifications.setTags({tagName1:tagValue1, tagName2:tagValue2});

 

© 2015 BulkPush.com By Broadnet Technologies Ltd.