Push Notification Service

Push Notification for the App42 Cloud API’s provides a complete Push Notification Management for any Mobile apps running on iOS/Android and Windows Phone. It supports Send Push Message To Channel, To User,To All.

Import Statement

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
import com.shephertz.app42.paas.sdk.android.App42BadParameterException;
import com.shephertz.app42.paas.sdk.android.App42Exception;
import com.shephertz.app42.paas.sdk.android.App42NotFoundException;
import com.shephertz.app42.paas.sdk.android.App42API;
import com.shephertz.app42.paas.sdk.android.push.DeviceType;
import com.shephertz.app42.paas.sdk.android.push.PushNotification;
import com.shephertz.app42.paas.sdk.android.push.PushNotificationService;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.push;   
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"   
Not Available
import com.shephertz.app42.paas.sdk.java.App42BadParameterException;
import com.shephertz.app42.paas.sdk.java.App42Exception;
import com.shephertz.app42.paas.sdk.java.App42NotFoundException;
import com.shephertz.app42.paas.sdk.java.App42API;
import com.shephertz.app42.paas.sdk.java.push.DeviceType;
import com.shephertz.app42.paas.sdk.java.push.PushNotification;
import com.shephertz.app42.paas.sdk.java.push.PushNotificationService;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.push; 
<script type="text/javascript" src="App42-all-x.x.x.min.js">&lt;/script>
local App42API = require("App42-Lua-API.App42API") 
require("App42-Lua-API.DeviceType")
require("App42-Lua-API.Operator")
#include "App42API.h"
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.push;  
include_once '../PushNotificationService.php';  
include_once '../DeviceType.php';
include_once '../App42Log.php';  
include_once '../App42Exception.php';  
include_once '../App42NotFoundException.php';  
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php';  
include_once '../StorageService.php';
include_once '../QueryBuilder.php';
include_once '../Query.php';
#include "App42API.h"
require 'App42_Ruby_API'
import com.shephertz.app42.paas.sdk.as3.App42API;
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.push.Channel;
import com.shephertz.app42.paas.sdk.as3.push.PushNotification;
import com.shephertz.app42.paas.sdk.as3.push.PushNotificationService;
Coming Soon
Coming Soon

Initialize

In order to use various the functions available in a specific API, a developer has to initialize with App42API by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.

Required Parameters

apiKey - The Application key given when the application was created. secretKey - The secret key corresponding to the application key given when the application was created.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
Not Available
App42API.initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
App42API:initialize("API_KEY","SECRET_KEY")
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API::initialize("API_KEY","SECRET_KEY"); 
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
App42API.initialize("API_KEY","SECRET_KEY");
Coming Soon
Coming Soon

Build Service

After initialization, developer needs to call the buildXXXService method on App42API to get the instance of the particular API that you wish to build. For example, To build an instance of PushNotificationService, buildPushNotificationService() method needs to be called.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
Not Available 
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
var pushNotificationService  = new App42Push();
local pushNotificationService  = App42API:buildPushNotificationService()
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
$pushNotificationService = App42API::buildPushNotificationService(); 
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
push_notification_service = api.build_push_notification_service() 
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
Coming Soon
Coming Soon

Upload P12 File For iOS

Upload apiKey/certificate to server that will be used while sending notifications to the devices.

Required Parameters

apiKey - the apiKey which you have received while registering for GCM. password - Password which has been given while export .p12 file. filePath - Path of certificates.p12 file. environment - It can be development or production.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String apikey = "api Key";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.uploadApiKey(apikey, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println(pushNotification);			
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
Not Available
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"Certificate" ofType:@".p12"];
NSString *password = @"******";
NSString *environment = @"development";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService uploadFile:password filePath:filePath environment:environment completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"fileName is %@" , pushNotification.fileName);
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Not Available
Coming Soon 
Coming Soon

Store Device Token

Stores your device token on server with particular username.

Required Parameters

userName - username with which you want your device to be registered. deviceToken - Device Token that has to be registered. deviceType - Type of the device like Android, iOS , WP7.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.storeDeviceToken(userName, deviceToken, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;			
	System.out.println("userName is " + pushNotification.getUserName()); 
	System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.StoreDeviceToken(userName,deviceToken, new Callback()); 
public class Callback : App42Callback  
{    
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;   
		Console.WriteLine("UserName is " + pushNotification.GetUserName());
		Console.WriteLine("Type is " +  pushNotification.GetType());
		Console.WriteLine("DeviceToken is " +  pushNotification.GetDeviceToken());		
	}  
}  
NSString *userName = @"Nick";
NSString *deviceToken =  @"Device Token";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService registerDeviceToken:deviceToken withUser:userName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"type is %@" ,  pushNotification.type);
		NSLog(@"type is %@" ,  pushNotification.deviceToken);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String deviceToken = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.storeDeviceToken(userName,deviceToken,DeviceType.ANDROID);   
System.out.println("userName is " + pushNotification.getUserName());
System.out.println("type is " +  pushNotification.getType());	
System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());
String jsonResponse = pushNotification.toString();   
String userName = "Nick";
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.StoreDeviceToken(userName,deviceToken,DeviceType.ANDROID, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("UserName is " + pushNotification.GetUserName());
		App42Log.Console("Type is " +  pushNotification.GetType());
		App42Log.Console("DeviceToken is " +  pushNotification.GetDeviceToken());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.storeDeviceToken(userName, deviceToken,DeviceType.ANDROID,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("Type is : " +  result.type);
		console.log("DeviceToken is : " +  result.deviceToken);	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local deviceToken = "Device Token";
local deviceType= DeviceType.ANDROID;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:storeDeviceToken(userName,deviceToken,deviceType,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Username is "..object:getUserName()); 
  print("Type is "..object:getType());
  print("DeviceToken is "..object:getDeviceToken());
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* deviceToken = "Device Token";
const char* userName = "Nick";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->RegisterDeviceToken(deviceToken, userName, deviceType, app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n Type  = %s",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.StoreDeviceToken(userName,deviceToken,DeviceType.ANDROID);   
Console.WriteLine("UserName is " + pushNotification.GetUserName());
Console.WriteLine("Type is " +  pushNotification.GetType());
Console.WriteLine("DeviceToken is " +  pushNotification.GetDeviceToken());		
String jsonResponse = pushNotification.ToString();   
$userName ="Nick";
$deviceToken = "Device Token";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->storeDeviceToken($userName,$deviceToken , DeviceType::WP7);
print_r("UserName is " . $pushNotification->getUserName());
print_r("Type is " . $pushNotification->getType());
print_r("DeviceToken is " . $pushNotification->getDeviceToken());
$jsonResponse = $pushNotification->toString();  
const char* deviceToken = "Device Token";
const char* userName = "Nick";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->RegisterDeviceToken(deviceToken, userName, deviceType, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n Type  = %s",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
user_name = "Nick";
device_token = "Device Token";
dtype = App42::AppTab::DeviceType.new();
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.store_device_token(user_name, device_token, dtype.enum("WP7")); 
puts "UserName is #{push_notification.user_name}";
puts "Type is #{push_notification.type}";
puts "DeviceToken is #{push_notification.device_token}"; 
json_response = push_notification.to_s(); 
var userName:String = "Nick";
var deviceToken:String = "Device Token";
var deviceType:String= DeviceType.ANDROID;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.storeDeviceToken(userName , deviceToken, deviceType , new callback());		
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("UserName is " + pushNotification.getUserName());
		trace("Type is " +  pushNotification.getType());
		trace("DeviceToken is " +  pushNotification.getDeviceToken());		
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
} 
Coming Soon 
Coming Soon

Create Channel For App

Create Channel for app on which user can subscribe and get the notification for that channel.

Required Parameters

channel - Channel name which you want to create. description - Description for that channel.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel";
String description = "Channel all about the news";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.createChannelForApp(channel, description, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList(); 
	for(PushNotification.Channel channelObj : channelList)  
	{  	
		System.out.println("channelName is " + channelObj.getName());  
		System.out.println("Description is " +  channelObj.getDescription());     
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String channel = "News Channel";
String description = "Channel all about the news";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.CreateChannelForApp(channel,description, new Callback());   
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception : "+ exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;    
		Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());
		Console.WriteLine("Description is " +  pushNotification.GetChannelList()[0].GetDescription());
	}  
}  
NSString *channel = @"News Channel";
NSString *description = @"Channel all about the news";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService createChannelForApp:channel description:description completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String channel = "News Channel";
String description = "Channel all about the news";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.createChannelForApp(channel,description);   
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList(); 
for(PushNotification.Channel channelObj : channelList)  
{  	
	System.out.println("channelName is " + channelObj.getName());  
	System.out.println("Description is " +  channelObj.getDescription());     
} 
String jsonResponse = pushNotification.toString();   
String channel = "News Channel";
String description = "Channel all about the news";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.CreateChannelForApp(channel,description, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;    
		App42Log.Console("channelName is " + pushNotification.GetChannelList()[0].GetName());
		App42Log.Console("Description is " +  pushNotification.GetChannelList()[0].GetDescription());
	}  

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channel = "News Channel",
description = "Channel all about the news",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.createChannelForApp(channel, description,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push.channels.channel;
		console.log("ChannelName is : " + result.channelName)	
		console.log("Description is: " +  result.description);	
	},  
	error: function(error) {  
	}  
}); 
local channel = "News Channel";
local description = "Channel all about the news";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:createChannelForApp(channel,description,App42CallBack);
function App42CallBack:onSuccess(object) 
  print("channelName is :"..object:getChannelList():getName())
  print("Description is: "..object:getChannelList():getDescription()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* channel = "News Channel";
const char* description = "Channel all about the news";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->CreateChannel(channel,description, app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
                printf("\n Description=%s\n",channel->description.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel";
String description = "Channel all about the news";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.CreateChannelForApp(channel,description);   
Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());
Console.WriteLine("Description is " +  pushNotification.GetChannelList()[0].GetDescription());	
String jsonResponse = pushNotification.ToString();   
$channel = "News Channel";
$description = "Channel all about the news";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->createChannelForApp($channel,$description);    
$channel = $pushNotification->getChannelList();
foreach($channel as $channelList)
{
	print_r("channelName is " . $channelList->getName());
	print_r("Description is " . $channelList->getDescription());
} 
$jsonResponse = $pushNotification->toString();  
const char* channel = "News Channel";
const char* description = "Channel all about the news";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->CreateChannel(channel,description, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
                printf("\n Description=%s\n",channel->description.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
channel = "News Channel";
description = "channel all about the news";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.create_channel_for_app(channel, description); 
channel_list = Array.new();
channel_list = push_notification.channel_list();
for channel_obj in channel_list
  puts "ChannelName is #{channel_obj.channel_name}";
  puts "Description is #{channel_obj.channel_description}";
end
json_response = push_notification.to_s();
var channel:String = "News Channel";
var description:String = "Channel all about the news";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.createChannelForApp(channel,description,new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
				trace("Description is : "+ Channel(pushNotification.getChannelList()[j]).getDescription());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Subscribe To Channel

User will be subscribed to the selected existing Channel.

Required Parameters

channel - Name of the channel which you want to subscribe. userName - Name of the user which you want to subscribe for the channel.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel";
String userName = "Nick";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.subscribeToChannel(channel, userName, new App42CallBack() {
public void onSuccess(Object response)
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("UserName is " + pushNotification.getUserName());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	}   
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String channel = "News Channel";
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SubscribeToChannel(channel,userName,new Callback());   
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;   
		Console.WriteLine("userName is " +  pushNotification.GetUserName());	  
		Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());  
	}  
}  
NSString *channel = @"News Channel";
NSString *userName = @"Nick";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService subscribeToChannel:channel userName:userName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String channel = "News Channel";
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.subscribeToChannel(channel,userName);  
System.out.println("UserName is " + pushNotification.getUserName());  
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
}   
String channel = "News Channel";
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SubscribeToChannel(channel,userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;   
		App42Log.Console("userName is " +  pushNotification.GetUserName());	  
		App42Log.Console("channelName is " + pushNotification.GetChannelList()[0].GetName());  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channel = "News Channel",
userName = "Nick",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.subscribeToChannel(channel, userName,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push.channels.channel;
		console.log("UserName is : " + pushNotification.app42.response.push.userName)	
		console.log("ChannelName is : " + result.channelName)	
	},  
	error: function(error) {  
	}  
}); 
local channel = "News Channel";
local userName = "Nick";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:subscribeToChannel(channel,userName,App42CallBack);
function App42CallBack:onSuccess(object)
  print("UserName is "..object:getUserName()); 
  print("ChannelName :"..object:getChannelList():getName())
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* userName = "Nick";
const char* channelName = "News Channel";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SubscribeToChannel(channelName,userName, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel";
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SubscribeToChannel(channel,userName); 
Console.WriteLine("userName is " +  pushNotification.GetUserName());	  
Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());
$channelName = "News Channel";
$userName = "Nick";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->subscribeToChannel($channelName,$userName);    
print_r("UserName is " . $pushNotification->getUserName());
$channel = $pushNotification->getChannelList();
foreach($channel as $channelList)
{
	print_r("channelName is " . $channelList->getName());
}
const char* userName = "Nick";
const char* channelName = "News Channel";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SubscribeToChannel(channelName,userName, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
channel_name = "News Channel";
user_name = "Nick";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.subscribe_to_channel(channel_name, user_name);
puts "UserName is #{push_notification.user_name}";
channel_list = Array.new();
channel_list = push_notification.channel_list();
for channel_obj in channel_list
  puts "channelName is #{channel_obj.name}";
end
var channel:String = "News Channel";
var userName:String = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.subscribeToChannel(	channel , userName, new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name : "+pushNotification.getUserName());
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Unsubscribe From Channel

Unsubscribe from particular channel.

Required Parameters

channel - Name of the channel which you want to unsubscribe. userName - Name of the user which you want to unsubscribe from the channel.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel";
String userName = "Nick";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.unsubscribeFromChannel(channel, userName, new App42CallBack() {
public void onSuccess(Object response)
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("UserName is " + pushNotification.getUserName());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String channel = "News Channel";
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.UnsubscribeFromChannel(channel,userName,new Callback());  
public class Callback : App42Callback  
{   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;   
		Console.WriteLine("userName is " +  pushNotification.GetUserName());	 
		Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName()); 
	}  
}  
NSString *channel = @"News Channel";
NSString *userName = @"Nick";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService unsubscribeFromChannel:channel userName:userName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String channel = "News Channel";
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.unsubscribeFromChannel(channel,userName);  
System.out.println("UserName is " + pushNotification.getUserName());  
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
}  
String channel = "News Channel";
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.UnsubscribeFromChannel(channel,userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;   
		App42Log.Console("userName is " +  pushNotification.GetUserName());	 
		App42Log.Console("channelName is " + pushNotification.GetChannelList()[0].GetName()); 
	}  

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channel = "News Channel",
userName = "Nick",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.unsubscribeFromChannel(channel, userName,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push.channels.channel;
		console.log("UserName is : " + pushNotification.app42.response.push.userName)	
		console.log("ChannelName is : " + result.channelName)	
	},  
	error: function(error) {  
	}  
}); 
local channel = "News Channel";
local userName = "Nick";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:unsubscribeFromChannel(channel,userName,App42CallBack);
function App42CallBack:onSuccess(object)
  print("UserName is "..object:getUserName()); 
  print("GetName :"..object:getChannelList():getName())
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* userName = "Nick";
const char* channelName = "News Channel";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeFromChannel(channelName,userName, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel";
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.UnsubscribeFromChannel(channel,userName); 
Console.WriteLine("userName is " +  pushNotification.GetUserName());	 
Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());
$channelName = "News Channel";
$userName = "Nick";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->unsubscribeFromChannel($channelName,$userName);    
print_r("UserName is " . $pushNotification->getUserName());
$channel = $pushNotification->getChannelList();
foreach($channel as $channelList)
{
	print_r("channelName is " . $channelList->getName());
}	
const char* userName = "Nick";
const char* channelName = "News Channel";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeFromChannel(channelName,userName, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
channel_name = "News Channel";
user_name = "Nick";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.unsubscribe_to_channel(channel_name, user_name);
puts "UserName is #{push_notification.user_name}";
channel_list = Array.new();
channel_list = push_notification.channel_list();
for channel_obj in channel_list
  puts "channelName is #{channel_obj.name}";
end
json_response = push_notification.to_s(); 
var channel:String = "News Channel";
var userName:String = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.unsubscribeFromChannel(	channel , userName, new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name : "+pushNotification.getUserName());
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
} 
Coming Soon 
Coming Soon

Send Push Message To Channel

Send push message to a particular channel.

Required Parameters

channel - Name of the channel for which you want to send message. message - Message which you want to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel";
String message  = "Message which you have to send";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToChannel(channel,message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String channel = "News Channel";
String message  = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToChannel(channel,message,new Callback());  
public class Callback : App42Callback  
{   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;     
		String jsonResponse = pushNotification.ToString();  
	}  
}  
NSString *channelName = @"News Channel";
NSString *message = @"Message";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToChannel:channelName withMessage:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String channel = "News Channel";
String message  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushMessageToChannel(channel,message);   
System.out.println("Message is " + pushNotification.getMessage());  
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
} 
String jsonResponse = pushNotification.toString();   
String channel = "News Channel";
String message  = "Message which you have to send";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToChannel(channel,message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("channel is : " + pushNotification.GetChannelList()[0].GetName());
	}

	public void OnException(Exception e)	
	{
		App42Log.Console("Exception : " + e);
	}
}
var channel = "News Channel",
message  = "Message which you have to send",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToChannel(channel, message,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push.channels.channel;
		console.log("Message is : " + pushNotification.app42.response.push.message)	
		console.log("ChannelName is : " + result.channelName)	
	},  
	error: function(error) {  
	}  
}); 
local channel = "News Channel";
local message  = "Message which you have to send";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToChannel(channel,message,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is :"..object:getMessage()); 
  print("channel is :"..object:getChannelList():getName())
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* channelName = "News Channel";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, message,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel";
String message  = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushMessageToChannel(channel,message);   
Console.WriteLine("channelName is " + pushNotification.GetChannelList()[0].GetName());
Console.WriteLine("message is " +  pushNotification.GetMessage());	
String jsonResponse = pushNotification.ToString();   
$channelName = "News Channel";
$message  = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToChannel($channelName,$message);    
print_r("Message is " . $pushNotification->getMessage());
$channel = $pushNotification->getChannelList();
foreach ($channel as $channelList) 
{
	print_r("channelName is " . $channelList->getName());
}
$jsonResponse = $pushNotification->toString();  
const char* channelName = "News Channel";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, message, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
channel = "News Channel";
message = "Message which you have to send";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.send_push_message_to_channel(channel, message);
puts "Message is #{push_notification.message}";
channel_list = Array.new();
channel_list = push_notification.channel_list();
for channel_obj in channel_list
  puts "channelName is #{channel_obj.name}";
end
json_response = push_notification.to_s();
var channel:String = "News Channel";
var message:String  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToChannel(channalName,message ,new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("Message is : " + pushNotification.getMessage());    
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
    Coming Soon 
Coming Soon

Send Push Message To All

Send push message to all your users.

Required Parameters

message - Message which you want to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String message  = "Message which you have to send";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToAll( message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	System.out.println("Expiry is " + pushNotification.getExpiry()); 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String message  = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToAll(message,new Callback());  
public class Callback : App42Callback  
{   
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		 PushNotification pushNotification = (PushNotification) response;     
		 String jsonResponse = pushNotification.ToString();  
	  }  
}  
NSString *message  = @"Message which you have to send";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToAll:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" , pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String message  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushMessageToAll(message);   
System.out.println("Message is " + pushNotification.getMessage());  
System.out.println("Expiry is " + pushNotification.getExpiry()); 
String jsonResponse = pushNotification.toString();   
String message  = "Message which you have to send";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToAll(message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var message  = "Message which you have to send",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToAll( message,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("Message is : " + result.message)	
		console.log("Expiry is : " + result.expiry)	
	},  
	error: function(error) {  
	}  
}); 
local message  = "Message which you have to send";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToAll(message,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is :"..object:getMessage()); 
  print("Expiry is : "..object:getExpiry()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToAll(message,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String message  = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushMessageToAll(message);   
Console.WriteLine("message is " +  pushNotification.GetMessage());	
String jsonResponse = pushNotification.ToString();   
$message  = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToAll($message);    
print_r("message is " .  $pushNotification->getMessage());
print_r("Expiry is " .  $pushNotification->getExpiry());
$jsonResponse = $pushNotification->toString();  
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToAll(message,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
message = "Message which you have to send";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.send_push_message_to_all(message);
puts "Message is #{push_notification.message}";
json_response = push_notification.to_s();
var message:String  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToAll(message,new callback());		
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());   
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Send Push Message To All By Type

Send push message to all by device type which is subscribed e.g :- WP7/Android/iOS

Required Parameters

message - Message which you want to send. deviceType - Type of device for which you want to send a message.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
Not Available
Not Available
Not Available
Not Available
String message  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushMessageToAllByType(message,DeviceType.ANDROID);   
System.out.println("message is " +  pushNotification.getMessage());	
String jsonResponse = pushNotification.toString();   
String message  = "Message which you have to send";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToAllByType(message, DeviceType.ANDROID, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var message  = "Message which you have to send",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToAllByType( message, DeviceType.ANDROID,{  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log(("Type is : " +  result.type);
		console.log("Message is : " + result.message)	
		console.log("Expiry is : " + result.expiry)	
	},  
	error: function(error) {  
	}  
}); 
local message  = "Message which you have to send";
local deviceType= DeviceType.ANDROID;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToAllByType(message,deviceType,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is :"..object:getMessage()); 
  print("Expiry is :"..object:getExpiry()); 
  print("Type is :"..object:getType()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* message = "Message which you have to send";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToAllByType(message,deviceType,app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
            printf("\n Type  = %s",it->type.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String message  = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushMessageToAllByType(message,DeviceType.ANDROID);   
Console.WriteLine("message is " +  pushNotification.GetMessage());	
String jsonResponse = pushNotification.ToString();   
$message  = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToAllByType($message,DeviceType::ANDROID);    
print_r("Message is :".$pushNotification->getMessage());
print_r("Expiry is :".$pushNotification->getExpiry());
print_r("Type is :".$pushNotification->getType());
$jsonResponse = $pushNotification->toString();  
const char* message = "Message which you have to send";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToAllByType(message,deviceType,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
            printf("\n Type  = %s",it->type.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
message = "Message which you have to send";
dtype = App42::AppTab::DeviceType.new();
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.send_push_message_to_all_by_type(message, dtype.enum("ANDROID"));
puts "Message is #{push_notification.message}";
puts "Type is #{push_notification.type}";
json_response = push_notification.to_s();
var message:String  = "Message which you have to send";
var deviceType:String= DeviceType.ANDROID;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToAllByType(message, deviceType,new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("Device Type is : "+pushNotification.getType());
		trace("Expiry is :" + pushNotification.getExpiry());    
		trace("Message is : " + pushNotification.getMessage());    
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
    Coming Soon 
Coming Soon

Send Custom Push Message To Channel In Key Value Or JSON Format

Send push message to channel containing JSON. On receive of this message on device, it has to be parsed and accessed accordingly.

Required Parameters

channel - Name of the channel for which you want to send message. message - Message which you want to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channelName = "News Channel";
HashMap< String,String> message = new HashMap< String,String>();
message.put("alert", "Hello! This is my first notification.");
message.put("badge", "1"); //Applicable for iOS only
message.put("sound", "default"); //Applicable for iOS only
message.put("sendingFrom", "Android"); //This is Custom application key
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToChannel(channelName, message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
Not Available 
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
NSString *channelName = @"News Channel";  
[dictionary setObject:@"Hello! This is my first notification." forKey:@"alert"];
[dictionary setObject:@"default" forKey:@"sound"]; // Applicable only for iOS push notification
[dictionary setObject:@"2" forKey:@"badge"]; // Applicable only for iOS push notification
[dictionary setObject:@"iOS" forKey:@"sendingFrom"]; // This is custom application key
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToChannel:channelName withMessageDictionary:dictionary completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" , pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
Not Available
Not Available
Not Available
Not Available
const char* channelName = "News Channel";
map<string, string> messageMap;
messageMap["alert"] = "Hello! This is my first notification.";
messageMap["sound"] = "default";
messageMap["badge"] = "1";
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, messageMap,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());

            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
                printf("\n Description=%s\n",channel->description.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Not Available
Not Available
const char* channelName = "News Channel";
map<string, string> messageMap;
messageMap["alert"] = "Hello! This is my first notification.";
messageMap["sound"] = "default";
messageMap["badge"] = "1";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, messageMap, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());

            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
                printf("\n Description=%s\n",channel->description.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
 Not Available
Not Available
Coming Soon 
Coming Soon

Send Push Message To User

Send push message to a particular user.

Required Parameters

userName - Name of the user which you want to send the message. message - Message which you want to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String message = "Message which you have to send";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToUser(userName, message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName());  
	System.out.println("Message is " + pushNotification.getMessage()); 
	System.out.println("Expiry is"+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String message = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToUser(userName,message,new Callback());  
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		 PushNotification pushNotification = (PushNotification) response;     
		 String jsonResponse = pushNotification.ToString();  
	  }  
}  
NSString *userName = @"Nick";
NSString *message = @"Message which you have to send";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToUser:userName message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" , pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}]; 
Not Available
String userName = "Nick";
String message = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushMessageToUser(userName,message);   
System.out.println("userName is " + pushNotification.getUserName());  
System.out.println("Message is " + pushNotification.getMessage()); 
System.out.println("Expiry is"+pushNotification.getExpiry());
String jsonResponse = pushNotification.toString();   
String userName = "Nick";
String message = "Message which you have to send";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToUser(userName,message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("userName is : " + pushNotification.GetMessage());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
message  = "Message which you have to send",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToUser( userName,message, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.getUserName());
		console.log("Message is : " + result.message)	
		console.log("Expiry is : " + result.expiry)	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local message  = "Message which you have to send";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToUser(userName,message,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getExpiry()); 
  print("UserName is "..object:getUserName()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* userName = "Nick";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToUser(userName,message,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick";
String message = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushMessageToUser(userName,message);   
Console.WriteLine("userName is " + pushNotification.GetUserName());
Console.WriteLine("message is " + pushNotification.GetMessage());
String jsonResponse = pushNotification.ToString();  
$userName = "Nick";
$message = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToUser($userName,$message); 
print_r("Message is :".$pushNotification->getMessage());
print_r("Expiry is :".$pushNotification->getExpiry());
print_r("UserName is :".$pushNotification->getUserName());
$jsonResponse = $pushNotification->toString();   
const char* userName = "Nick";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToUser(userName,message,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
user_name = "Nick";
message = "Message which you have to send";					
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
push_notification_service = api.build_push_notification_service() 
push_notification = push_notification_service.send_push_message_to_user(user_name, message);
puts "User Name is #{push_notification.user_name}";
puts "Message is #{push_notification.message}";
json_response = push_notification.to_s();
var userName:String = "Nick";
var message:String = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToUser(userName,message,new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());    
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Send Custom Push Message To User In Key Value Or JSON Format

Send push message to user containing JSON or in key-value format. On receive of this message on device, it has to be parsed and accessed accordingly.

Required Parameters

userName - Name of the user to which message has to be send. message - Message which you want to send in JSON or key-value format.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
HashMap< String,String> message = new HashMap< String,String>();
message.put("alert", "Hello! This is my first notification.");
message.put("badge", "1"); //Applicable for iOS only
message.put("sound", "default"); //Applicable for iOS only
message.put("sendingFrom", "Android"); //This is Custom application key
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToUser( userName, message, new App42CallBack() {
public void onSuccess(Object response)
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName());  
	System.out.println("Message is " + pushNotification.getMessage()); 
	System.out.println("Expiry is"+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
Not Available 
NSString *userName  = @"Nick";
NSDictionary *messageDictionary = [[NSDictionary alloc]init];
[messageDictionary setObject:@"Hello! This is my first notification." forKey:@"alert"]; 
[messageDictionary setObject:@"1" forKey:@"badge"]; //Applicable for iOS only
[messageDictionary setObject:@"default" forKey:@"sound"]; //Applicable for iOS only
[messageDictionary setObject:@"iOS" forKey:@"sendingFrom"]; //This is Custom application key
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToUser:userName withMessageDictionary:messageDictionary completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" , pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
Not Available
Not Available
Not Available
Coming Soon
const char* userName = "Nick";
map<string, string> messageMap;
messageMap["alert"] = "Hello! This is my first notification.";
messageMap["sound"] = "default";
messageMap["badge"] = "1";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToUser(userName, messageMap,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Not Available
$userName = "Nick";  
$message = "{'alert':'Hello! This is my first notification.','badge':1,'sound':'default','sendingFrom':'serverSide'}"; 
//Here sound and badge are applicable only for iOS push notification and sendingFrom key is custom application key used.
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToUser($userName,$message);
const char* userName = "Nick";
map<string, string> messageMap;
messageMap["alert"] = "Hello! This is my first notification.";
messageMap["sound"] = "default";
messageMap["badge"] = "1";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToUser(userName, messageMap,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Not Available
Not Available
Coming Soon 
Coming Soon

Subscribe To Channel With device token

Subscribe your device to a particular channel with device token and type.

Required Parameters

userName - Username which want to subscribe. channelName - Name of channel for which user want to subscribe. deviceToken - Device token which you want to subscribe. deviceType - Device Type which you want to subscribe.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.subscribeToChannel(userName, channel, deviceToken,  DeviceType.ANDROID, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("UserName is " + pushNotification.getUserName());  
	System.out.println("Device Token "+pushNotification.getDeviceToken());
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});               
 
String channel = "News Channel";
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SubscribeToChannel(userName, channel, deviceToken,new Callback());   
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		 PushNotification pushNotification = (PushNotification) response;     
		 String jsonResponse = pushNotification.ToString();  
	  }  
}   
NSString *userName = @"Nick";
NSString *deviceToken = @"Device_Token";
NSString *channelName = @"New Channel";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService subscribeToChannel:channelName userName:userName deviceToken:deviceToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token"
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.subscribeToChannel(userName, channel, deviceToken, DeviceType.iOS);
System.out.println("UserName is " + pushNotification.getUserName());  
System.out.println("Device Token "+pushNotification.getDeviceToken());
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
}  
String jsonResponse = pushNotification.toString();               
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SubscribeToChannel(userName, channel, deviceToken, DeviceType.iOS, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("userName is : " + pushNotification.GetMessage());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channel = "News Channel",
userName = "Nick",
deviceToken = "Device Token",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.registerAndSubscribe( channel,userName,deviceToken,DeviceType.ANDROID, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("Type is : " +  result.type);
		console.log("DeviceToken is : " +  result.deviceToken);	
		console.log("Channel Name is :" + pushNotification.app42.response.push.channels.channel.channelName)
	},  
	error: function(error) {  
	}  
});
local channel = "News Channel";
local userName = "Nick";
local deviceToken = "Device Token";
local deviceType= DeviceType.ANDROID;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:registerAndSubscribe(userName,channel,deviceToken,deviceType,App42CallBack);
function App42CallBack:onSuccess(object)
  print("userName is :"..object:getUserName()); 
  print("userName is :"..object:getType()); 
  print("userName is :"..object:getDeviceToken()); 
  print("Channel Name is :"..object:getChannelList():getName())
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* channel = "News Channel" ;
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SubscribeToChannel(channelName,userName,deviceToken, deviceType, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SubscribeToChannel(userName, channel, deviceToken, DeviceType.iOS);
System.out.println(pushNotification.GetUserName());
String jsonResponse = pushNotification.ToString();                  
$channel = "News Channel" ;
$userName = "Nick" ;
$deviceToken = "Device Token";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->registerAndSubscribe($userName, $channel, $deviceToken, DeviceType::ANDROID);
print_r("UserName Is :" . $pushNotification->getUserName());
print_r("Device token Is :" . $pushNotification->getDeviceToken());
print_r("Type Is :" . $pushNotification->getType());
$channel = $pushNotification->getChannelList();
foreach ($channel as $channelList) 
{
	print_r("Channel  Is :" . $channelList->getName());
}
const char* channel = "News Channel" ;
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
DeviceType deviceType = IOS;
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SubscribeToChannel(channelName,userName,deviceToken, deviceType, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type  = %s",it->type.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var channel:String = "News Channel" ;
var userName:String = "Nick" ;
var deviceToken:String = "Device Token";
var deviceType:String= DeviceType.ANDROID;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.registerAndSubscribe(userName,channel, deviceToken,deviceType,new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("DeviceToken :"+pushNotification.getDeviceToken());
		trace("Device Type : "+pushNotification.getType());
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}		

Coming Soon
Coming Soon

Unsubscribe Device To Channel

Unsubscribe your device to a particular channel with device token.

Required Parameters

userName - Name of user who want to unsubscribe to channel. channelName - Name of channel for which user want to unsubscribe. deviceToken - Device token which you want to unsubscribe.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.unsubscribeDeviceToChannel(userName, channel, deviceToken, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("UserName is " + pushNotification.getUserName());  
	System.out.println("Device Token "+pushNotification.getDeviceToken());
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
	System.out.println("channelName is " + channelObj.getName());  
	}     
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});                 
String channel = "News Channel";
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.UnsubscribeDeviceToChannel(userName, channel, deviceToken,new Callback());  
public class Callback : App42Callback  
 {   
	public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		 PushNotification pushNotification = (PushNotification) response;     
		 String jsonResponse = pushNotification.ToString();  
	  }  
  }    
NSString *userName = @"Nick";
NSString *deviceToken = @"Device_Token";
NSString *channelName = @"New Channel";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService unsubscribeDeviceToChannel:channelName userName:userName deviceToken:deviceToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSMutableArray *channelArray = pushNotification.channelList;               
		for(Channel *channel in channelArray) 
		{  
			NSLog(@"Channel Name is = %@ " , channel.channelName);  
		}  
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.unsubscribeDeviceToChannel(userName, channel, deviceToken);
System.out.println("UserName is " + pushNotification.getUserName());  
System.out.println("Device Token "+pushNotification.getDeviceToken());
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
}  
String jsonResponse = pushNotification.toString();                
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.UnsubscribeDeviceToChannel(userName, channel, deviceToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
channel = "News Channel"
deviceToken = "Device Token",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.unsubscribeDeviceToChannel(userName,channel,deviceToken, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("DeviceToken is : " +  result.deviceToken);	
		console.log("Channel Name is :" + pushNotification.app42.response.push.channels.channel.channelName)
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local channel = "News Channel";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:unsubscribeDeviceToChannel(userName,channel,deviceToken,App42CallBack);
function App42CallBack:onSuccess(object)
  print("getStrResponse is : "..object:getStrResponse());
  print("userName is :"..object:getUserName());
  print("userName is :"..object:getDeviceToken()); 
  print("Channel Name is :"..object:getChannelList():getName())
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* channel = "News Channel" ;
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeDeviceToChannel(channelName,userName,deviceToken,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String channel = "News Channel" ;
String userName = "Nick" ;
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotificationObj = pushNotificationService.UnsubscribeDeviceToChannel(userName, channel, deviceToken);
Console.WriteLine(pushNotification.getUserName());
String jsonResponse = pushNotification.ToString();                    
$channel = "News Channel" ;
$userName = "Nick" ;
$deviceToken = "Device Token";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification= $pushNotificationService->unsubscribeDeviceToChannel($userName, $channel, $deviceToken);
print_r("UserName Is :" . $pushNotification->getUserName());
print_r("Device token Is :" . $pushNotification->getDeviceToken());
$channel = $pushNotification->getChannelList();
foreach ($channel as $channelList) 
{
	print_r("Channel  Is :" . $channelList->getName());
}
const char* channel = "News Channel" ;
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeDeviceToChannel(channelName,userName,deviceToken,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
            for(std::vector<App42Channel>::iterator channel = it->channelArray.begin(); channel != it->channelArray.end(); ++channel)
            {
                printf("\n Channel Name=%s",channel->channelName.c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var channel:String = "News Channel" ;
var userName:String = "Nick" ;
var deviceToken:String = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.unsubscribeDeviceToChannel(userName, channel, deviceToken, new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("DeviceToken :"+pushNotification.getDeviceToken());
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
Coming Soon
Coming Soon

Delete Device Token

Unsubscribe your device form push-notification service.

Required Parameters

userName - Name of user whose device token has to delete. deviceToken - Device token which has to be deleted.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.deleteDeviceToken(userName, deviceToken, new App42CallBack() {
public void onSuccess(Object response)
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.DeleteDeviceToken(userName,devicetoken,new Callback()); 
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification success = (PushNotification) response;
		Console.WriteLine("success is" + success.IsResponseSuccess());
	}  
}  
NSString *userName = @"Nick";
NSString *deviceToken = @"Device_Token";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService deleteDeviceToken:userName deviceToken:deviceToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{	
	if (success)
	{
		App42Response *response = (App42Response*)responseObj;
		NSString *success = response.isResponseSuccess;
		NSString *jsonResponse = [response toString];        
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String userName = "Nick";
String deviceToken = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
App42Response app42response = pushNotificationService.deleteDeviceToken(userName, deviceToken); 
System.out.println("response is " + app42response) ; 
boolean  success = app42response.isResponseSuccess();
System.out.println("success is" + success);                
String userName = "userName" ;
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.DeleteDeviceToken(userName, deviceToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;    
		App42Log.Console("response is " + app42response) 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
result ;  
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.deleteDeviceToken(userName,deviceToken, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("Response is : " + result)	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick1";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:deleteDeviceToken(userName,deviceToken,App42CallBack);
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->DeleteDeviceToken(deviceToken,userName, app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
App42Response success =  pushNotificationService.DeleteDeviceToken(userName, deviceToken);
Console.WriteLine("success is : " + success);                
$userName = "Nick";
$deviceToken = "Device Token";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$response = $pushNotificationService->deleteDeviceToken($userName, $deviceToken);
print_r("Response is : ".$response->toString());
const char* userName = "Nick" ;
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->DeleteDeviceToken(deviceToken,userName, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken  = %s",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var userName:String = "Nick";
var deviceToken:String = "Device Token";	
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.deleteDeviceToken(userName, deviceToken, new callback());	
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response); 
		trace("response is : "+ app42Response); 
	} 
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}   
} 
Coming Soon
Coming Soon

Send Push Message To Group

Send push message to list of specific users.

Required Parameters

message - Message which you have to send. userList - List of the users for which message has to be send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String message = "Message which you have to send";
ArrayList<String> userList =  new ArrayList<String>();
userList.add("Nick");
userList.add("John");
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToGroup(message,userList, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	System.out.println("Expiry is "+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});        
String message = "Message which you have to send";
IList<String> userList = new List<String>();
userList.add("Nick");
userList.add("John");
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToGroup(message,userList,new Callback()); 
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("Response is" + pushNotification.GetMessage());
		Console.WriteLine("Response is" + pushNotification.GetExpiry());
	}  
}  
NSString *message = @"Message which you have to send";
NSArray *userList = [NSArray arrayWithObjects:@"Nick",@"John", nil];
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToGroup:userList message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" ,  pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String message = "Message which you have to send";
ArrayList<String> userList =  new ArrayList<String>();
userList.add("Nick");
userList.add("John");
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotificationObj = pushNotificationService.sendPushMessageToGroup(message, userList);
System.out.println("Message is " + pushNotification.getMessage());  
System.out.println("Expiry is "+pushNotification.getExpiry());                
String message = "Message which you have to send" ;
IList<String> userList = new List<String>();
userList.add("Nick");
userList.add("John");
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToGroup(message,userList, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("Message is " + pushNotification.GetExpiry());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var message="Message which you have to send",
result ; 
var userList = new Array();
userList.push("Nick")
userList.push("John"); 
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToGroup(message,userList, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("Message is " + result.message);
		console.log("Expiry is " + result.expiry);
	},  
	error: function(error) {  
	}  
}); 
local message="Message which you have to send"
local userList={}
userList[1]="Nick";   
userList[2]="John";  
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToGroup(message,userList,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is "..object:getMessage()); 
  print("Expiry is "..object:getExpiry()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* message = "Message which you have to send";
std::vector<std::string>userList;
userList.push_back("Nick");
userList.push_back("John");
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToGroup(userList, message, app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String message = "Message which you have to send";
IList<String> userList =  new List<String>();
userList.add("Nick");
userList.add("John");
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotificationObj = pushNotificationService.SendPushMessageToGroup(message, userList);
Console.WriteLine(pushNotificationObj.GetMessage());
Console.WriteLine(pushNotificationObj.GetExpiry());
$message = "Message which you have to send";
$userList= array();
array_push($userList, "Nick");
array_push($userList, "John");
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToGroup($message, $userList);
print_r("Message Is :" . $pushNotification->getMessage());
print_r("Expiry Is :" . $pushNotification->getExpiry());
const char* message = "Message which you have to send";
std::vector<std::string>userList;
userList.push_back("Nick");
userList.push_back("John");
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToGroup(userList, message, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var message:String = "Message which you have to send";
var userList:Array = new Array();
userList.push("Nick");
userList.push("John");
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToGroup(message,userList,new callback());	 
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());   
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon
Coming Soon

Send Push To Target Users

Send push message to target users using storage query. This method fetches users from target database and collection using passed query and sends push notification to them.

Required Parameters

message - Message which you have to send. dbName - Unique handler for storage name. collectionName - Name of collection under which message has to be send. query - Query object containing custom query for sending push message to that target users.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String message = "Message which you have to send";
String dbName = "<Your_database_name>";    
String collectionName = "<Your_collection_name>";     
String key1 = "name";     
String value1 = "Nick";    
String key2 = "age";        
int value2 = 30;      
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);        
// Pass aggregated query  to finder method below. Similarly you can aggregate more conditions in querying object. 
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushToTargetUsers(message, dbName, collectionName, query, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	System.out.println("Expiry is "+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});        
String message = "Message which you have to send";
String dbName = "<Your_database_name>";    
String collectionName = "<Your_collection_name>";     
String key1 = "name";     
String value1 = "Nick";     
String key2 = "age";       
int value2 = 30;      
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);     
// Pass aggregated query  to finder method below. Similarly you can aggregate more conditions in querying object.      
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushToTargetUsers(message, dbName, collectionName, query,new Callback()); 
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("Message is :" + pushNotification.GetMessage());
		Console.WriteLine("Expiry is :" + pushNotification.GetExpiry());
	}  
}  
NSString *message = @"Message which you have to send";
NSString *dbName = @"<Your_database_name>";
NSString *collectionName = @"<Your_collection_name>";
NSString *key1 = @"name";
NSString *value1 = @"Nick";
NSString *key2 = @"age";
int value2 = 30;
// Build query q1 for key1 equal to name and value1 equal to Nick
Query *q1 = [QueryBuilder buildQueryWithKey:key1 value:value1 andOperator:APP42_OP_EQUALS];
// Build query q2 for key2 equal to age and value2 equal to 30
Query *q2 = [QueryBuilder buildQueryWithKey:key2 value:[NSNumber numberWithInt:value2] andOperator:APP42_OP_GREATER_THAN];
Query *q3 = [QueryBuilder combineQuery:q1 withQuery:q2 usingOperator:APP42_OP_OR];
// Pass aggregated query to sender method below. Similarly you can aggregate more conditions in querying object.
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushToTargetUsers:message dbName:dbName collectionName:collectionName query:query completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" ,  pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String message = "Message which you have to send";
String dbName = "<Your_database_name>";    
String collectionName = "<Your_collection_name>";     
String key1 = "name";     
String value1 = "Nick";    
String key2 = "age";        
int value2 = 30;      
Query q1 = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);        
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object. 
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushToTargetUsers(message, dbName, collectionName, query);
System.out.println("Message is " + pushNotification.getMessage());  
System.out.println("Expiry is "+pushNotification.getExpiry());          
String message = "Message which you have to send";
String dbName = "<Your_database_name>";    
String collectionName = "<Your_collection_name>";     
String key1 = "name";     
String value1 = "Nick";    
String key2 = "age";        
int value2 = 30; 
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query to finder method below. Similarly you can aggregate more conditions in querying object.    
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushToTargetUsers(message, dbName, collectionName, query, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("Expiry is " + pushNotification.GetExpiry());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var message="Message which you have to send",
result ; 
var dbName = "<Your_DataBase_Name>",  
collectionName = "<Your_Collection_Name>",  
key1 = "name",    
value1 = "Nick",     
key2 = "age",  
value2 = 30;
var queryBuilder = new QueryBuilder();  
var q1= queryBuilder.build(key1, value1, Operator.EQUALS);      
var q2 = queryBuilder.build(key2, value2, Operator.GREATER_THAN);         
var query = queryBuilder.compoundOperator(q1,Operator.OR, q2);   
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushToTargetUsers(message, dbName,  collectionName, query, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("Message is " + result.message);
		console.log("Expiry is " + result.expiry);
	},  
	error: function(error) {  
	}  
}); 
local message = "Message which you have to send";
local dbName  = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>"
local key = "name"  
local value = "Nick"  
local key1 = "age"  
local value1 = 30  
local queryBuilder = require("App42-Lua-API.QueryBuilder")  
local q1 = queryBuilder:build(key, value, Operator.EQUALS)     
local q2 = queryBuilder:build(key1, value1, Operator.GREATER_THAN)        
local query = queryBuilder:compoundOperator(q1,Operator.OR, q2)  
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushToTargetUsers(message, dbName,  collectionName, query,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getExpiry()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* dbName = "<Your_database_name>";
const char* collectionName = "<Your_collection_name>";
string json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
App42API::setLoggedInUser("Nick");
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
storageService->InsertJsonDocument(dbName, collectionName, jsonDoc, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onStorageRequestCompleted(void *response)
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
       	const char* message= "Message which you have to send";
 		const char* key = "name";
		const char* value = "Nick";
		Query *query = QueryBuilder::BuildQuery(key, value, APP42_OP_EQUALS);
		pushService->SendPushToTargetUsers(message.c_str(), dbName, collectionName, query, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String message = "Message which you have to send";
String dbName = "<Your_database_name>";    
String collectionName = "<Your_collection_name>";    
String key1 = "name";     
String value1 = "Nick";       
String key2 = "age";     
int value2 = 30;      
Query q1 = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to Nick  
Query q2 = QueryBuilder.Build(key2, value2, Operator.GREATER_THAN); // Build query q2 for key2 equal to age and value2 equal to 30     
Query query = QueryBuilder.CompoundOperator(q1, Operator.OR, q2);         
// Pass aggregated query  to finder method below. Similarly you can aggregate more conditions in querying object.    
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushToTargetUsers(message, dbName, collectionName, query);
Console.WriteLine("Message is " + pushNotification.GetMessage());
Console.WriteLine("Expiry is "+ pushNotification.GetExpiry());
$message = "Message which you have to send";
$dbName = "<Your_database_name>";    
$collectionName = "<Your_collection_name>";    
$key1 = "name";     
$value1 = "Nick";       
$key2 = "age";     
$value2 = 30;   
$queryBuilder= new QueryBuilder();
$q1 = $queryBuilder->build($key1, $value1, Operator::EQUALS);// Build query q1 for key1 equal to name and value1 equal to Nick 
$q1 = $queryBuilder->build($key2, $value2, Operator::EQUALS);// Build query q2 for key2 equal to age and value2 equal to 30     
$query = $queryBuilder->compoundOperator($q1, Operator::ORop, $q2);  
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushToTargetUsers($message, $dbName, $collectionName, $query);
print_r("Message Is :" . $pushNotification->getMessage());
print_r("Expiry Is :" . $pushNotification->getExpiry());
const char* dbName = "<Your_database_name>";
const char* collectionName = "<Your_collection_name>";
string json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}";
App42API::setLoggedInUser("Nick");
storageService->InsertJsonDocument(dbName, collectionName, jsonDoc, this, app42callfuncND_selector(Sample_Class::onStorageRequestCompleted));
void Sample_Class::onStorageRequestCompleted(App42CallBack *sender, void *response)
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
{
    App42StorageResponse *storageResponse = (App42StorageResponse*)response;
    printf("\ncode=%d",storageResponse->getCode());
    printf("\nResponse Body=%s",storageResponse->getBody().c_str());
    if (storageResponse->isSuccess)
    {
       	const char* message= "Message which you have to send";
 		const char* key = "name";
		const char* value = "Nick";
		Query *query = QueryBuilder::BuildQuery(key, value, APP42_OP_EQUALS);
		pushService->SendPushToTargetUsers(message.c_str(), dbName, collectionName, query, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
    }
    else
    {
        printf("\nerrordetails:%s",storageResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",storageResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",storageResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",storageResponse->httpErrorCode);
    }
}

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var message:String = "Message which you have to send";
var dbName:String = "<Your_database_name>";    
var collectionName:String = "<Your_collection_name>";     
var key1:String = "name";     
var value1:String = "Nick";    
var key2:String = "age";        
var value2:int = 30;      
var q1:Query = QueryBuilder.build(key1,value1, Operator.EQUALS);// Build query q1 for key1 equal to name and value1 equal to Nick  
var q2:Query = QueryBuilder.build(key2,value2, Operator.GREATER_THAN);// Build query q2 for key2 equal to age and value2 equal to 30       
var query:Query = QueryBuilder.compoundOperator(q1, Operator.OR, q2);  
// Pass aggregated query  to finder method below. Similarly you can aggregate more conditions in querying object.      
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushToTargetUsers(message,dbName,collectionName ,query , new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());   
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon
Coming Soon

Schedule Message To User

Send message to a particular user with schedule time.

Required Parameters

userName - Name of the user which you want to send the message. message - Message which you have to send. scheduleDate - Time on which send messsage to user.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String message = "Message which you have to send";
Date scheduleDate = null; /* Get date from your source */  
String userName = "Nick";   
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.scheduleMessageToUser(userName, message, scheduleDate, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Username is " +pushNotification.getUserName());
	System.out.println("Message is " + pushNotification.getMessage());  
	System.out.println("Expiry is "+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});        
String userName = "Nick";
String message = "Message which you have to send";
DateTime scheduleDate = null; /* Get date from your source */
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.ScheduleMessageToUser(userName, message, scheduleDate, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("Username is " + pushNotification.GetUserName());
		Console.WriteLine("Message is " + pushNotification.GetMessage());
		Console.WriteLine("Expiry is " + pushNotification.GetExpiry());
	}
}  
NSDate *expiry = [NSDate date];
NSString *userName = @"Nick";
NSString *message = @"Message which you have to send";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService scheduleMessageToUser:userName expiryDate:expiry message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" ,  pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available         
 
String userName = "Nick"; 
String message = "Message which you have to send";
Date scheduleDate = null; /* Get date from your source */   
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.scheduleMessageToUser(userName, message, scheduleDate);
System.out.println("Username is " +pushNotification.getUserName());
System.out.println("Message is " + pushNotification.getMessage());  
System.out.println("Expiry is "+pushNotification.getExpiry());          
String userName = "Nick";
String message = "Message which you have to send";
DateTime scheduleDate = null; /* Get date from your source */
App42Log.SetDebug(true);	 //Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.ScheduleMessageToUser(userName, message, scheduleDate, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console("Username is " +pushNotification.GetUserName());
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("Expiry is " + pushNotification.GetExpiry());
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var message = "Message which you have to send",
scheduleDate = null, /* Get date from your source */  
userName = "Nick", 
result ;     
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.scheduleMessageToUser(userName, message, scheduleDate, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("Message is " + result.message);
		console.log("Expiry is " + result.expiry);
	},  
	error: function(error) {  
	}  
}); 
Coming Soon
const char* userName = "Nick"; 
const char* message = "Message which you have to send";
tm *expiryDate;
time_t t = time(NULL);
expiryDate = gmtime(&t);
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->ScheduleMessageToUser(userName, message, expiryDate, app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick"; 
String message = "Message which you have to send";
DateTime scheduleDate = null; /* Get date from your source */   
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.ScheduleMessageToUser(userName, message, scheduleDate);
Console.WriteLine("Username is " +pushNotification.GetUserName());
Console.WriteLine("Message is " +pushNotification.GetMessage());
Console.WriteLine("Expiry is "+pushNotification.GetExpiry());
$userName = "Nick"; 
$message = "Message which you have to send";
$date = date(DATE_ATOM, mktime());
$date2 = strtotime($date);
$newdate = strtotime('+2 day', strtotime($date));
$scheduleDate = date('Y-m-j', $date2);
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->scheduleMessageToUser($userName,$message,$scheduleDate);
print_r("Username is " .$pushNotification->getUserName());
print_r("Message is " .$pushNotification->getMessage());
print_r("Expiry is ".$pushNotification->getExpiry());
const char* userName = "Nick"; 
const char* message = "Message which you have to send";
tm *expiryDate;
time_t t = time(NULL);
expiryDate = gmtime(&t);
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->ScheduleMessageToUser(userName, message, expiryDate, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var message:String = "Message which you have to send";
var scheduleDate:Date= null; /* Get date from your source */ 
var userName:String = "Nick";  
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.scheduleMessageToUser(userName,message,scheduleDate, new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());    
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon

Send Multilingual Push Notification

Send multilingual(UTF-8) push message to a particular user.Note Same can done for sending push methods.

Required Parameters

userName - Name of the user which you want to send the message. message - Message which you want to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String message = "Message which you have to send";
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("dataEncoding", "true");
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.setOtherMetaHeaders(otherMetaHeaders)
pushNotificationService.sendPushMessageToUser(userName, message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName());  
	System.out.println("Message is " + pushNotification.getMessage()); 
	System.out.println("Expiry is"+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String message = "Message which you have to send";
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("dataEncoding", "true");
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SetOtherMetaHeaders(otherMetaHeaders);
pushNotificationService.SendPushMessageToUser(userName,message,new Callback());  
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		 PushNotification pushNotification = (PushNotification) response;     
		 String jsonResponse = pushNotification.ToString();  
	  }  
}  
NSString *userName= @"Nick";
NSString *message = @"Message which you have to send";
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"true",@"dataEncoding", nil];
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService setOtherMetaHeaders:dict];
[pushNotificationService sendPushMessageToUser:userName message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" ,  pushNotification.message);
		NSLog(@"Expiry=%@",pushNotification.expiry);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String message = "Message which you have to send";
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("dataEncoding", "true");
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.setOtherMetaHeaders(otherMetaHeaders)
PushNotification pushNotification = pushNotificationService.sendPushMessageToUser(userName,message);   
System.out.println("userName is " + pushNotification.getUserName());  
System.out.println("Message is " + pushNotification.getMessage()); 
System.out.println("Expiry is"+pushNotification.getExpiry());
String jsonResponse = pushNotification.toString();   
String userName = "Nick";
String message = "Message which you have to send";
App42Log.SetDebug(true);		//Print output in your editor console
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("dataEncoding", "true");
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SetOtherMetaHeaders(otherMetaHeaders);
pushNotificationService.SendPushMessageToUser(userName,message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("Message is " + pushNotification.GetMessage());
		App42Log.Console("userName is : " + pushNotification.GetUserName());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
message  = "Message which you have to send",
result ;  
var otherMetaHeaders={dataEncoding:true};
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.setOtherMetaHeaders(otherMetaHeaders);
pushNotificationService.sendPushMessageToUser( userName,message, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.getUserName());
		console.log("Message is : " + result.message)	
		console.log("Expiry is : " + result.expiry)	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local message  = "Message which you have to send";
local App42CallBack = {}
local otherMetaHeaders = {};
otherMetaHeaders.dataEncoding= "true";
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:setOtherMetaHeaders(otherMetaHeaders);
pushNotificationService:sendPushMessageToUser(userName,message,App42CallBack);
function App42CallBack:onSuccess(object)
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getExpiry()); 
  print("UserName is "..object:getUserName()); 
end  
function App42CallBack:onException(object)
  print("Message is "..object:getAppErrorCode()); 
  print("Message is "..object:getHttpErrorCode()); 
  print("Message is "..object:getMessage()); 
  print("Message is "..object:getDetails()); 
end
const char* userName = "Nick";
const char* message = "Message which you have to send";
map<string,string> otherMetaHeaders;
otherMetaHeaders["dataEncoding"] = "true";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->setOtherMetaHeaders(otherMetaHeaders);
pushService->SendPushMessageToUser(userName,message,app42callback(Sample_Class::onPushRequestCompleted, this));

void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick";
String message = "Message which you have to send";
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("dataEncoding", "true");
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
pushNotificationService.SetOtherMetaHeaders(otherMetaHeaders);
PushNotification pushNotification = pushNotificationService.SendPushMessageToUser(userName,message);   
Console.WriteLine("userName is " + pushNotification.GetUserName());
Console.WriteLine("message is " + pushNotification.GetMessage());
String jsonResponse = pushNotification.ToString();  
$userName = "Nick";
$message = "Message which you have to send";
$otherMetaHeaders = array();
$otherMetaHeaders['dataEncoding'] ="true";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotificationService->setOtherMetaHeaders($otherMetaHeaders);
$pushNotification = $pushNotificationService->sendPushMessageToUser($userName,$message); 
print_r("Message is :".$pushNotification->getMessage());
print_r("Expiry is :".$pushNotification->getExpiry());
print_r("UserName is :".$pushNotification->getUserName());
$jsonResponse = $pushNotification->toString();   
const char* userName = "Nick";
const char* message = "Message which you have to send";
map<string,string> otherMetaHeaders;
otherMetaHeaders["dataEncoding"] = "true";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->setOtherMetaHeaders(otherMetaHeaders);
pushService->SendPushMessageToUser(userName,message,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));

void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Message=%s\n",it->message.c_str());
            printf("\n Expiry=%s\n",it->expiry.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var userName:String = "Nick";
var message:String = "Message which you have to send";
var otherMetaHeaders:Dictionary = new Dictionary();
otherMetaHeaders["dataEncoding"] = "true";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.setOtherMetaHeaders(otherMetaHeaders);
pushNotificationService.sendPushMessageToUser(userName,message,new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());    
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Unsubscribe Device

Unsubscribe device from push-notification further user will not receive any push-notifications.

Required Parameters

userName - Name of the user which you want unsubscribe from push-notifications. deviceToken - Device token which you want to unsubscribe.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.unsubscribeDevice(userName, deviceToken, new App42CallBack() {
public void onSuccess(Object response)
{
	PushNotification pushNotification  = (PushNotification)response;			
	System.out.println("userName is " + pushNotification.getUserName()); 
	System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());
	System.out.println("Type is "+ pushNotification.getType());
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.UnsubscribeDevice(userName, deviceToken, new Callback());  
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		PushNotification pushNotification = (PushNotification) response;  
		Console.WriteLine("UserName is : " + pushNotification.GetUserName());
		Console.WriteLine("DeviceToken is : " + pushNotification.GetDeviceToken());
		Console.WriteLine("Type is " + pushNotification.GetType());
	  }  
}  
NSString *userName = @"Nick";
NSString *deviceToken = @"Device Token";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService unsubscribeDeviceForUser:userName deviceToken:deviceToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.unsubscribeDevice(userName, deviceToken);
System.out.println("userName is " + pushNotification.getUserName()); 
System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());
System.out.println("Type is "+ pushNotification.getType());
String userName = "Nick";
String deviceToken = "Device Token";	
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.UnsubscribeDevice(userName,deviceToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("UserName is : " + pushNotification.GetUserName());
		App42Log.Console("DeviceToken is : " + pushNotification.GetDeviceToken());
		App42Log.Console("Type is " + pushNotification.GetType());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.unsubscribeDevice( userName,deviceToken, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("Type is : " +  result.type);
		console.log("DeviceToken is : " +  result.deviceToken);	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:unsubscribeDevice(userName,deviceToken,App42CallBack);
function App42CallBack:onSuccess(object)
	print("DeviceToken is : "..object:getDeviceToken()); 
	print("Type is " ..object:getType()); 
	print("UserName is "..object:getUserName());
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeDevice(deviceToken, userName,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type=%s\n",it->type.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick"; 
String deviceToken = "Device Token";  
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.UnsubscribeDevice(userName, deviceToken);
Console.WriteLine("UserName is " +pushNotification.GetUserName());
Console.WriteLine("Message is " +pushNotification.GetMessage());
Console.WriteLine("Type is " + pushNotification.GetType());
$userName ="Nick";
$deviceToken = "Device Token";  
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->unsubscribeDevice($userName,$deviceToken);
print_r("UserName is " . $pushNotification->getUserName());
print_r("Type is " . $pushNotification->getType());
print_r("DeviceToken is " . $pushNotification->getDeviceToken());
$jsonResponse = $pushNotification->toString();  
const char* userName = "Nick";
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->UnsubscribeDevice(deviceToken, userName,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type=%s\n",it->type.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var userName:String = "Nick";
var deviceToken:String = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.unsubscribeDevice(userName, deviceToken);
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("UserName is " + pushNotification.getUserName());
		trace("Type is " +  pushNotification.getType());
		trace("DeviceToken is " +  pushNotification.getDeviceToken());		
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
} 
Coming Soon 
Coming Soon

Resubscribe Device

Resubscribe device from push-notification which you unsubscribe.

Required Parameters

userName - Name of the user which you want resubscribe from push-notifications. deviceToken - Device token which you want to resubscribe.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.resubscribeDevice(userName, deviceToken, new App42CallBack() {
public void onSuccess(Object response)
{
	PushNotification pushNotification  = (PushNotification)response;			
	System.out.println("userName is " + pushNotification.getUserName()); 
	System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());
	System.out.println("Type is "+ pushNotification.getType());
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.ReSubscribeDevice(userName, deviceToken, new Callback());  
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		PushNotification pushNotification = (PushNotification) response;  
		Console.WriteLine("UserName is : " + pushNotification.GetUserName());
		Console.WriteLine("DeviceToken is : " + pushNotification.GetDeviceToken());
		Console.WriteLine("Type is " + pushNotification.GetType());
	  }  
}  
NSString *userName = @"Nick";
NSString *deviceToken = @"Device Token";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService resubscribeDeviceForUser:userName deviceToken:deviceToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String deviceToken = "Device Token";	
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.resubscribeDevice(userName, deviceToken);
System.out.println("userName is " + pushNotification.getUserName()); 
System.out.println("DeviceToken is " +  pushNotification.getDeviceToken());
System.out.println("Type is "+ pushNotification.getType());
String userName = "Nick";
String deviceToken = "Device Token";	
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.ReSubscribeDevice(userName,deviceToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;  
		App42Log.Console("UserName is : " + pushNotification.GetUserName());
		App42Log.Console("DeviceToken is : " + pushNotification.GetDeviceToken());
		App42Log.Console("Type is " + pushNotification.GetType());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.resubscribeDevice( userName,deviceToken, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("Type is : " +  result.type);
		console.log("DeviceToken is : " +  result.deviceToken);	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:resubscribeDevice(userName,deviceToken,App42CallBack);
function App42CallBack:onSuccess(object)
	print("DeviceToken is : "..object:getDeviceToken()); 
	print("Type is " ..object:getType()); 
	print("UserName is "..object:getUserName());
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->ResubscribeDevice(deviceToken, userName,app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type=%s\n",it->type.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick"; 
String deviceToken = "Device Token";  
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.ReSubscribeDevice(userName, deviceToken);
Console.WriteLine("UserName is " +pushNotification.GetUserName());
Console.WriteLine("Message is " +pushNotification.GetMessage());
Console.WriteLine("Type is " + pushNotification.GetType());
$userName ="Nick";
$deviceToken = "Device Token";  
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->resubscribeDevice($userName,$deviceToken);
print_r("UserName is " . $pushNotification->getUserName());
print_r("Type is " . $pushNotification->getType());
print_r("DeviceToken is " . $pushNotification->getDeviceToken());
$jsonResponse = $pushNotification->toString();  
const char* userName = "Nick";
const char* deviceToken = "Device Token";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->ResubscribeDevice(deviceToken, userName,this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Type=%s\n",it->type.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var userName:String = "Nick";
var deviceToken:String = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.resubscribeDevice(userName, deviceToken);
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("UserName is " + pushNotification.getUserName());
		trace("Type is " +  pushNotification.getType());
		trace("DeviceToken is " +  pushNotification.getDeviceToken());		
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
} 
Coming Soon 
Coming Soon

Delete All Devices

Delete all devices of particular user.

Required Parameters

userName - Name of the user which you want to delete the message.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.deleteAllDevices(userName,new App42CallBack() {		
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message " + ex.getMessage());
}
});   
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.DeleteAllDevices(userName, new Callback());  
public class Callback : App42Callback  
{  
	 public void OnException(App42Exception exception)  
	  {  
		Console.WriteLine("Exception Message : " + exception);  
	  }  
	  public void OnSuccess(Object response)  
	  {  
		App42Response app42response = (App42Response) response;  
		Console.WriteLine("App42Response is : " + app42response.ToString());
	  }  
}  
NSString *userName = @"Nick";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService deleteAllDevices:userName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{	
	if (success)
	{
		App42Response *response = (App42Response*)responseObj;
		NSString *success = response.isResponseSuccess;
		NSString *jsonResponse = [response toString];        
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
App42Response app42response = pushNotificationService.deleteAllDevices(userName);
System.out.println("response is " + app42response) ;
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.DeleteAllDevices(userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;  
		App42Log.Console("App42Response is : " + app42response.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.deleteAllDevices( userName,message, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		console.log("Response is "+pushNotification)
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:deleteAllDevices(userName,App42CallBack);
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->DeleteAllDevices(userName, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
String userName = "Nick"; 
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
App42Response app42response = pushNotificationService.DeleteAllDevices(userName);
Console.WriteLine("App42Response is : " + app42response.ToString());
$userName = "Nick";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$response = $pushNotificationService->deleteAllDevices($userName); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString();  
const char* userName = "Nick";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->DeleteAllDevices(userName, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        for(std::vector<App42PushNotification>::iterator it = pushResponse->notifications.begin(); it != pushResponse->notifications.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n DeviceToken=%s\n",it->deviceToken.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
    }
}
Coming Soon
var userName:String = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.deleteAllDevices(userName,new callback()); 
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("response is " + app42response) 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
} 
Coming Soon 
Coming Soon

Send Push Message To Device

Send push message to a particular device.

Required Parameters

userName - Name of the user which you want to send the message. deviceToken - Name of the device token which you want to send the message. message - Message which you have to send.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String message = "Message which you have to send";
String deviceToken = "Device Token";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToDevice(userName,deviceToken, message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName());  
	System.out.println("Message is " + pushNotification.getMessage()); 
	System.out.println("Expiry is"+pushNotification.getExpiry());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String userName = "Nick";
String message = "Message which you have to send";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToDevice(userName, deviceToken, message, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("UserName is " + pushNotification.GetUserName());
		Console.WriteLine("Message is " + pushNotification.GetMessage());
		Console.WriteLine("Expiry is " + pushNotification.GetExpiry());
	}
}  
NSString *deviceToken = @"Device Token";
NSString *userName = @"Nick";
NSString *message = @"Message which you have to send";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService sendPushMessageToDevice:deviceToken userName:userName message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"message is %@" ,  pushNotification.message);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String message = "Message which you have to send";
String deviceToken = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.sendPushMessageToDevice(userName,deviceToken, message); 
System.out.println("userName is " + pushNotification.getUserName());  
System.out.println("Message is " + pushNotification.getMessage()); 
System.out.println("Expiry is"+pushNotification.getExpiry());
String userName = "Nick";
String message = "Message which you have to send";
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToDevice(userName, deviceToken, message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console("userName is " + pushNotification.GetUserName());  
		App42Log.Console("Message is " + pushNotification.GetMessage()); 
		App42Log.Console("Expiry is"+pushNotification.GetExpiry());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
message = "Message which you have to send",
deviceToken = "Device Token",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToDevice(userName,deviceToken,message, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.getUserName());
		console.log("Message is : " + result.message)	
		console.log("Expiry is : " + result.expiry)	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local message = "Message which you have to send";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:sendPushMessageToDevice(userName,deviceToken,message,App42CallBack);
function App42CallBack:onSuccess(object)
	print("Message is "..object:getMessage()); 
	print("Expiry is "..object:getExpiry()); 
	print("UserName is "..object:getUserName()); 
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String userName = "Nick";
String message = "Message which you have to send";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.SendPushMessageToDevice(userName, message, deviceToken);
Console.WriteLine("UserName is " + pushNotification.GetUserName());  
Console.WriteLine("Message is " + pushNotification.GetMessage()); 
Console.WriteLine("Expiry is"+pushNotification.GetExpiry());
$userName ="Nick";
$deviceToken = "Device Token";
$message  = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->sendPushMessageToDevice($userName,$deviceToken,$message);  
print_r("UserName is " .$pushNotification->getUserName());
print_r("Message is ".$pushNotification->getMessage());
print_r("Expiry is".$pushNotification->getExpiry());
Not Available
Coming Soon
var userName:String = "Nick";
var deviceToken:String = "Device Token";
var message:String  = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.sendPushMessageToDevice(userName,deviceToken, message,new callback());		
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("userName is " + pushNotification.getUserName());
		trace("Expiry is " + pushNotification.getExpiry());    
		trace("Message is " + pushNotification.getMessage());   
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}
Coming Soon 
Coming Soon

Update Push Badge For Device

This method is used to update push badge count of a particular device registered by the user .

Required Parameters

userName - Name of the user which you want to update the badge count. deviceToken - Device token which you want to update the badge count. badges - Number of badge count you want to update.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";
int badges= 5;
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.updatePushBadgeforDevice(userName,deviceToken, badges, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName()); 
	System.out.println("DeviceToken :"+pushNotification.getDeviceToken());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String deviceToken = "Device Token";
int badges= 5;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.UpdatePushBadgeforDevice(userName, deviceToken, badges, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("UserName is " + pushNotification.GetUserName());
		Console.WriteLine("Message is " + pushNotification.GetMessage());
		Console.WriteLine("Expiry is " + pushNotification.GetExpiry());
	}
}  
NSString *deviceToken = @"Device Token";
NSString *userName = @"Nick";
int badge = 5;
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService updatePushBadgeforDevice:deviceToken userName:userName badges:badge completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSLog(@"Device Token=%@",pushNotification.deviceToken);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
String deviceToken = "Device Token";
int badges= 5;
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.updatePushBadgeforDevice(userName,deviceToken, badges); 
System.out.println("UserName is :" + pushNotification.getUserName()); 
System.out.println("DeviceToken :"+pushNotification.getDeviceToken());
String userName = "Nick";
String deviceToken = "Device Token";
int badges= 5;
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.UpdatePushBadgeforDevice(userName, deviceToken, badges, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console("userName is " + pushNotification.GetUserName());  
		App42Log.Console("DeviceToken :"+pushNotification.GetDeviceToken()); 
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
badges= 5,
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.updatePushBadgeforDevice(userName,deviceToken,badges, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("DeviceToken is : " +  result.deviceToken);	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local deviceToken = "Device Token";
local badges= 5;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushService:updatePushBadgeforDevice(userName,deviceToken,badges, App42CallBack);
function App42CallBack:onSuccess(object)
	print("Device Token is "..object:getDeviceToken()); 
	print("UserName is "..object:getUserName()); 
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String userName = "Nick";
String deviceToken = "Device Token";
int badges= 5;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.UpdatePushBadgeforDevice(userName, deviceToken, badges);
Console.WriteLine("UserName is " + pushNotification.GetUserName()); 
Console.WriteLine("DeviceToken :"+pushNotification.GetDeviceToken()); 
$userName = "Nick" ;
$deviceToken = "Device Token";
$badges=5;
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->updatePushBadgeforDevice($userName, $deviceToken, 5);
print_r("User Name  : ".$pushNotification->getUserName());
print_r("DeviceToken :".$pushNotification->getDeviceToken()); 
Not Available
Coming Soon
var userName:String = "Nick" ;
var deviceToken:String = "Device Token";
var badges:int=5;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.updatePushBadgeforDevice(userName, deviceToken,badges,new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("DeviceToken :"+pushNotification.getDeviceToken());
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
Coming Soon 
Coming Soon

Update Push Badge For User

This method is used to update push badge count of all the devices that a user procures. In this case, we are assuming that the user has multiple devices registered under his name.

Required Parameters

userName - Name of the user which you want to update the badge count. badges - Number of badge count you want to update.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
int badges= 5;
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.updatePushBadgeforUser(userName, badges, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName()); 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
int badges= 5;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.UpdatePushBadgeforUser(userName, badges, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("UserName is " + pushNotification.GetUserName());
		Console.WriteLine("Message is " + pushNotification.GetMessage());
		Console.WriteLine("Expiry is " + pushNotification.GetExpiry());
	}
}  
NSString *userName = @"Nick";
int badges = 5;
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService updatePushBadgeforUser:userName badges:badges completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSLog(@"userName is %@" , pushNotification.userName);
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
Not Available
String userName = "Nick";
int badges= 5;
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.updatePushBadgeforUser(userName, badges); 
System.out.println("UserName is :" + pushNotification.getUserName()); 
String userName = "Nick";
int badges= 5;
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.UpdatePushBadgeforUser(userName, badges, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console("userName is " + pushNotification.GetUserName());  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
badges= 5,
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.updatePushBadgeforUser(userName,badges, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
	},  
	error: function(error) {  
	}  
}); 
local userName = "Nick";
local badges= 5;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:updatePushBadgeforUser(userName,badges,App42CallBack);
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName()); 
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String userName = "Nick";
int badges= 5;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.UpdatePushBadgeforUser(userName, badges);
Console.WriteLine("UserName is " + pushNotification.GetUserName()); 
$userName = "Nick" ;
$badges=5;
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->updatePushBadgeforUser($userName,5);
print_r("User Name  : ".$pushNotification->getUserName());
Not Available
Coming Soon
var userName:String = "Nick" ;
var badges:int=5;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.updatePushBadgeforUser(userName,badges,new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
Coming Soon 
Coming Soon

Clear All Badge Count

This method is used to reset push badge count to 0 of a particular device registered by the user .

Required Parameters

userName - Name of the user which you want to clear the badge count. deviceToken - Device token which you want to clear the badge count.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String deviceToken = "Device Token";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.clearAllBadgeCount(userName,deviceToken, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("userName is " + pushNotification.getUserName()); 
	System.out.println("DeviceToken :"+pushNotification.getDeviceToken());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.ClearAllBadgeCount(userName, deviceToken, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine("UserName is " + pushNotification.GetUserName());
		Console.WriteLine("DeviceToken :"+pushNotification.GetDeviceToken());
	}
}  
Coming Soon
Not Available
String userName = "Nick";
String deviceToken = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.clearAllBadgeCount(userName,deviceToken); 
System.out.println("UserName is :" + pushNotification.getUserName()); 
System.out.println("DeviceToken :"+pushNotification.getDeviceToken());
String userName = "Nick";
String deviceToken = "Device Token";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.ClearAllBadgeCount(userName, deviceToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console("userName is " + pushNotification.GetUserName());  
		App42Log.Console("DeviceToken :"+pushNotification.GetDeviceToken());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
deviceToken = "Device Token",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.clearAllBadgeCount(userName,deviceToken, {  
	success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		result = pushNotification.app42.response.push;
		console.log("UserName is : " + result.userName)	
		console.log("DeviceToken is : " +  result.deviceToken);	
	},  
	error: function(error) {  
	}  
});
local userName = "Nick";
local deviceToken = "Device Token";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:clearAllBadgeCount(userName,deviceToken, App42CallBack);
function App42CallBack:onSuccess(object)
	print("Device Token is "..object:getDeviceToken()); 
	print("UserName is "..object:getUserName()); 
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Coming Soon
String userName = "Nick";
String deviceToken = "Device Token";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.ClearAllBadgeCount(userName, deviceToken);
Console.WriteLine("UserName is " + pushNotification.GetUserName()); 
Console.WriteLine("DeviceToken :"+pushNotification.GetDeviceToken());
$userName = "Nick" ;
$deviceToken = "Device Token";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->clearAllBadgeCount($userName, $deviceToken);
print_r("User Name  : ".$pushNotification->getUserName());
print_r("DeviceToken :".$pushNotification->getDeviceToken()); 
Not Available
Coming Soon
var userName:String = "Nick" ;
var deviceToken:String = "Device Token";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.clearAllBadgeCount(userName, deviceToken,new callback());	
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name  : "+pushNotification.getUserName());
		trace("DeviceToken :"+pushNotification.getDeviceToken());
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
Coming Soon 
Coming Soon

Delete Channel

Delete a particular channel from app.

Required Parameters

channelName - Name of the channel which you want to delete.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channelName = "News Channel";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.deleteChannel(channelName,new App42CallBack() {		
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message " + ex.getMessage());
}
});
String channelName = "News Channel";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.DeleteChannel(channelName, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		App42Response app42Response = (App42Response) response;
		Console.WriteLine("App42Response is " + app42Response.ToString());  
	}
}  
NSString *channelName = @"News Channel";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushService deleteChannel:channelName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		App42Response *app42Response = (App42Response*)responseObj;
		NSLog(@"isResponseSuccess=%d",app42Response.isResponseSuccess);
		NSLog(@"Response=%@",app42Response.strResponse);
		[self showResponse:app42Response.strResponse];

	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP Error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
		[self showResponse:[exception reason]];

	}
}];
Not Available
String channelName = "News Channel";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
App42Response app42response = pushNotificationService.deleteChannel(channelName);
System.out.println(app42response);
String channelName = "News Channel";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.DeleteChannel(channelName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;
		App42Log.Console("App42Response is " + app42Response.ToString());  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channelName = "News Channel",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.deleteChannel(channelName,{
    success: function(object) 
	{  
		var pushNotification = JSON.parse(object);  
		console.log("Response is "+pushNotification)
	},  
	error: function(error) {  
	}  
});
local channelName = "News Channel";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:deleteChannel(channelName, App42CallBack);
function App42CallBack:onSuccess(object)
	print("Response is : "..object:getStrResponse());
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Not Available
String channelName = "News Channel";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
App42Response app42Response = pushNotificationService.DeleteChannel(channelName);
Console.WriteLine("App42Response is " + app42Response.ToString());  
$channelName = "News Channel";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$app42Response = $pushNotificationService->deleteChannel($channelName);
print_r("App42Response is " .$app42Response->toString());
Not Available
Not Available
var channelName:String = "News Channel";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.deleteChannel(channalName, new callback());	
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("response is " + app42response) 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Not Available
Coming Soon

Get Channel Users Count

Gets the count of the users who are subscribed on a particular channel.

Required Parameters

channelName - Name of channel for which you want to get the count.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channelName = "News Channel";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.getChannelUsersCount(channelName, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Records : " + app42response.getTotalRecords()) ;
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String channelName = "News Channel";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.GetChannelUsersCount(channelName, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		App42Response app42Response = (App42Response) response;
		Console.WriteLine("App42Response is " + app42Response.ToString());  
		Console.WriteLine("TotalRecords " + app42Response.GetTotalRecords());  
	}
}  
Not Available
Not Available
String channelName = "News Channel";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
App42Response app42response = pushNotificationService.getChannelUsersCount(channelName);
System.out.println("Total Records : " + app42response.getTotalRecords());
String channelName = "News Channel";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.GetChannelUsersCount(channelName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;
		App42Log.Console("App42Response is : " + app42Response.ToString());  
		App42Log.Console("TotalRecords : " + app42Response.GetTotalRecords());  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channelName = "News Channel",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.getChannelUsersCount(channelName,{
	success: function(object) 
	{
		var pushNotification = JSON.parse(object);
		result = pushNotification.app42.response;
		console.log("Total record is " + result.totalRecords);
	},
	error: function(error) {
	}
});   
local channelName = "News Channel";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:getChannelUsersCount(channelName, App42CallBack);
function App42CallBack:onSuccess(object)
	print("Response is : "..object:getStrResponse());
    print("Total record is "..object:getTotalRecords());  
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Not Available
String channelName = "News Channel";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
App42Response app42Response = pushNotificationService.GetChannelUsersCount(channelName);
Console.WriteLine("App42Response is " + app42Response.ToString());  
Console.WriteLine("TotalRecords : " + app42Response.GetTotalRecords());  
$channelName = "News Channel";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$app42Response = $pushNotificationService->getChannelUsersCount($channelName);
print_r("App42Response is " .$app42Response->toString());
print_r("TotalRecords : ".$app42Response->getTotalRecords());
Not Available
Not Available
var channelName:String = "News Channel";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.getChannelUsersCount(channalName, new callback());	
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("Total Records is " + app42response.getTotalRecords()); 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Not Available
Coming Soon

Get Channel Users

Gets the users list for a particular channel by paging.

Required Parameters

channelName - Name of channel for which you want to get users. max - Maximum number of users to be fetched. offset - From where the users are to be fetched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channelName = "News Channel";
int max = 1;
int offset = 0 ;
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.getChannelUsers(channelName,max,offset, new App42CallBack() {
public void onSuccess(Object response) 
{
		ArrayList<PushNotification> pushNotification = (ArrayList<PushNotification>)response;
		for(int i=0 ; i<pushNotification.size();i++)
		{
			System.out.println("user name is " + pushNotification.get(i).getUserName());
			System.out.println("device token is  " + pushNotification.get(i).getDeviceToken());
			System.out.println("type is " + pushNotification.get(i).getType());
			ArrayList<PushNotification.Channel> channelList = pushNotification.get(i).getChannelList();   
			for(PushNotification.Channel channelObj : channelList)    
			{     
				System.out.println("channelName is " + channelObj.getName());          
			}   
		}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});	
String channelName = "News Channel";
int max = 10;
int offset = 0;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.GetChannelUsers(channelName, max, offset, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		IList<PushNotification> pushNotification = (IList<PushNotification>) response;
		for (int i=0; i<pushNotification.Count; i++)
		       {
					Console.WriteLine("UserName : " + pushNotification[i].GetUserName());	
			   }
	}
}  
Not Available
Not Available
String channelName = "News Channel";
int max = 1;
int offset = 0 ;
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
ArrayList<PushNotification> pushNotification = pushNotificationService.getChannelUsers(channelName, max,offset);
for(int i=0 ; i<pushNotification.size();i++)
{
	System.out.println("user name is " + pushNotification.get(i).getUserName());
	System.out.println("device token is  " + pushNotification.get(i).getDeviceToken());
	System.out.println("type is " + pushNotification.get(i).getType());
	ArrayList<PushNotification.Channel> channelList = pushNotification.get(i).getChannelList();   
	for(PushNotification.Channel channelObj : channelList)    
	{     
		System.out.println("channelName is " + channelObj.getName());          
	}   
}
String channelName = "News Channel";
int max = 10;
int offset = 0;
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.GetChannelUsers(channelName, max, offset, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<PushNotification> pushNotification = (IList<PushNotification>) response;
		for (int i=0; i<pushNotification.Count; i++)
		       {
					App42Log.Console ("UserName : " + pushNotification[i].GetUserName());	
			   }
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var channelName = "News Channel",
max = 10,
offset = 0,
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.getChannelUsers(channelName,max,offset,{
	success: function(object) {
		var pushNotification = JSON.parse(object);
		result = pushNotification.app42.response.push
		if(result.length == undefined)  
		{  
			console.log("Channel Name :"+result.channels.channel)
			console.log("DeviceToken is "+result.deviceToken)
			console.log("Type is "+result.type) 
			console.log("UserName is "+result.userName) 
		}  
		else  
		for(var i = 0; i<result.length; i++)
		{  
			console.log("Channel Name :"+result[i].channels.channel)
			console.log("DeviceToken is "+result[i].deviceToken)
			console.log(("Type is "+result[i].type) 
			console.log("UserName is "+result[i].userName) 								
		}  
	},
	error: function(error) {
	}
}); 
local channelName = "News Channel";
local max = 10;
local offset = 0;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:getChannelUsers(channel ,max,offset, App42CallBack);
function App42CallBack:onSuccess(object)        
	if table.getn(object) > 1 then  
		for i=1,table.getn(object) do 
			print("UserName is "..object[i]:getUserName()); 
			print("Type is "..object[i]:getType());  
			print("DeviceToken is "..object[i]:getDeviceToken());  
			print("GetName :"..object[i]:getChannelList():getName());
		end  
	else  
		print("UserName is "..object:getUserName()); 
		print("Type is "..object:getType());  
		print("DeviceToken is "..object:getDeviceToken());  
		print("GetName :"..object:getChannelList():getName());
	end 
end  
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Not Available
String channelName = "News Channel";
int max = 10;
int offset = 0;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
IList<PushNotification> pushNotification  = pushNotificationService.GetChannelUsers(channelName, max, offset);
for (int i=0; i<pushNotification.Count; i++)
   {
		Console.WriteLine ("UserName : " + pushNotification[i].GetUserName());	
   }
$channelName = "News Channel";
$max = 10;
$offset = 0;
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->getChannelUsers($channelName,$max, $offset);
print_r("Push Notification Response is : " . $pushNotification[0]->toString());
for ($i = 0; $i < count($pushNotification); $i++) 
{
	print_r("UserName is " . $pushNotification[$i]->getUserName());
	print_r("device token is  " . $pushNotification[$i]->getDeviceToken());
	print_r("type is " . $pushNotification[$i]->getType());
	$channel = $pushNotification[$i]->getChannelList();
	foreach ($channel as $channelList) 
	{
		print_r("channelName is " . $channelList->getName());
	}
}
Not Available
Not Available
var channelName:String = "News Channel";
var max:int = 10;
var offset:int = 0;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.getChannelUsers(channalName,max,offset, new callback());	
class callback implements App42CallBack{
	public function onSuccess(response:Object):void
	{
		for(var i:int = 0;i < response.length;i++)
		{
			var pushNotification:PushNotification = PushNotification(response[i]);
			trace("User Name  : "+pushNotification.getUserName());
			trace("DeviceToken :"+pushNotification.getDeviceToken());
			trace("Device Type : "+pushNotification  .getType());
			if(pushNotification.getChannelList().length > 0)
			{
				for(var j:int=0;j<pushNotification.getChannelList().length;j++)
				{
					trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());				
				}
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Response is "+exception)
	}
}
Not Available
Coming Soon

Get User Subscribed Channels Count

Gets the count of all the subscribed channels of a particular user.

Required Parameters

userName - Name of the user for which you want to get a count of the subscribed channels.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.getUserSubscribedChannelsCount(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Records : " + app42response.getTotalRecords()) ;
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.GetUserSubscribedChannelsCount (userName, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		App42Response app42Response = (App42Response) response;
		Console.WriteLine("App42Response is " + app42Response.ToString());  
		Console.WriteLine("TotalRecords " + app42Response.GetTotalRecords());  
	}
}  
Not Available
Not Available
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
App42Response app42Response = pushNotificationService.getUserSubscribedChannelsCount(userName);
System.out.println("TotalRecords " + app42Response.getTotalRecords());
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.GetUserSubscribedChannelsCount (userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;
		App42Log.Console("App42Response is : " + app42Response.ToString());  
		App42Log.Console("TotalRecords " + app42Response.GetTotalRecords());  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.getUserSubscribedChannelsCount(userName,{
	success: function(object) 
	{
		var pushNotification = JSON.parse(object);
		result = pushNotification.app42.response;
		console.log("Total record is " + result.totalRecords);
	},
	error: function(error) {
	}
}); 
local userName = "Nick";
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushService:getUserSubscribedChannelsCount(userName , App42CallBack);
function callBack:onSuccess(object)
	print("Response is : "..object:getStrResponse());
	print("Total record is "..object:getTotalRecords());    
end  
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Not Available
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
App42Response app42Response = pushNotificationService.GetUserSubscribedChannelsCount (userName);
Console.WriteLine("App42Response is " + app42Response.ToString());  
Console.WriteLine("TotalRecords : " + app42Response.GetTotalRecords());  
$userName = "Nick";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$app42Response = $pushNotificationService->getUserSubscribedChannelsCount($userName);
print_r("App42Response is ".$app42Response->toString());
print_r("TotalRecords : " .$app42Response->getTotalRecords());
Not Available
Not Available
var userName:String = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.getUserSubscribedChannelsCount(userName, new callback());	
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("Total Records is " + app42response.getTotalRecords()); 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Not Available
Coming Soon

Get User Subscribed Channels

Gets the list of subscribed channels for a particular user by paging.

Required Parameters

userName - Name of the user for which you want to get the subscribed channels. max - Maximum number of channels to be fetched. offset - From where the channels are to be fetched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
int max = 1;
int offset = 0 ;
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.getUserSubscribedChannels(userName,max,offset, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("UserName is " + pushNotification.getUserName());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	}   
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";
int max = 10;
int offset = 0;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.GetUserSubscribedChannels(userName, max, offset, new Callback());
public class Callback : App42Callback
{
	public void OnException(App42Exception exception)
	{
		Console.WriteLine("Exception Message : " + exception);
	}
	public void OnSuccess(Object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		Console.WriteLine ("UserName : " + pushNotification.GetUserName());	
		for(int i = 0 ; i < pushNotification.GetChannelList().Count; i++ )
		{
			Console.WriteLine ("Description is : " + pushNotification.GetChannelList()[i].GetDescription());	
			Console.WriteLine ("Name is : " + pushNotification.GetChannelList()[i].GetName());	
			Console.WriteLine ("Type is : " + pushNotification.GetChannelList()[i].GetType());	
	    }
	}
}  
Not Available
Not Available
String userName = "Nick";
int max = 1;
int offset = 0 ;
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
PushNotification pushNotification = pushNotificationService.getUserSubscribedChannels(userName,max,offset);
System.out.println("UserName is " + pushNotification.getUserName());  
ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
for(PushNotification.Channel channelObj : channelList)  
{  
	System.out.println("channelName is " + channelObj.getName());  
}  
String userName = "Nick";
int max = 10;
int offset = 0;
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.GetUserSubscribedChannels(userName, max, offset, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		PushNotification pushNotification = (PushNotification) response;
		App42Log.Console ("UserName : " + pushNotification.GetUserName());	
		for(int i = 0 ; i < pushNotification.GetChannelList().Count; i++ )
		{
			App42Log.Console ("Description is : " + pushNotification.GetChannelList()[i].GetDescription());	
			App42Log.Console ("Name is : " + pushNotification.GetChannelList()[i].GetName());	
			App42Log.Console ("Type is : " + pushNotification.GetChannelList()[i].GetType());	
	    }
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
max = 10,
offset = 0,
result;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.getUserSubscribedChannels(userName,max,offset0,{
	success: function(object) {
	var pushNotification = JSON.parse(object);
	result = pushNotification.app42.response.push.channels.channel;
	console.log("ChannelName is : " + result.channelName)
	if(result.length == undefined)  
	{  	
		console.log("Channel Name :"+result.channelName)
	}  
	else  
		for(var i = 0; i<result.length; i++)
		{  
			console.log("Channel Name :"+result[i].channelName)							
		}  
	},
	error: function(error) {
	}
}); 
local userName = "Nick";
local max = 10;
local offset = 0;
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local pushNotificationService  = App42API:buildPushNotificationService()
pushNotificationService:getUserSubscribedChannels(userName , max,offset,App42CallBack);
function App42CallBack:onSuccess(object)
	print("Response is :"..JSON:encode(object));
	print("getStrResponse is : "..object:getStrResponse());
	print("UserName is "..object:getUserName()); 
	if table.getn(object:getChannelList()) >1 then   
	for i=1,table.getn(object:getChannelList()) do  
		print("Channel Name :"..object:getChannelList()[i]:getName());
	end  
	else  
		print("Channel Name:"..object:getChannelList():getName());
	end 
end  
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
Not Available
String userName = "Nick";
int max = 10;
int offset = 0;
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
PushNotification pushNotification = pushNotificationService.GetUserSubscribedChannels(userName, max, offset);
Console.WriteLine ("UserName : " + pushNotification.GetUserName());	
for(int i = 0 ; i < pushNotification.GetChannelList().Count; i++ )
{
	Console.WriteLine ("Description is : " + pushNotification.GetChannelList()[i].GetDescription());	
	Console.WriteLine ("Name is : " + pushNotification.GetChannelList()[i].GetName());	
	Console.WriteLine ("Type is : " + pushNotification.GetChannelList()[i].GetType());	
}
$userName = "Nick";
$max = 10;
$offset = 0;
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
$pushNotification = $pushNotificationService->getUserSubscribedChannels($userName,$max,$offset);      
print_r("Push Notification Response is : " . $pushNotification->toString());  
print_r("UserName is " . $pushNotification->getUserName()); 
$channel = $pushNotification->getChannelList();  
foreach($channel as $channelList)  
{  
	print_r("channelName is " . $channelList->getName());  
}  
Not Available
Not Available
var userName:String = "Nick";
var max:int = 10;
var offset:int = 0;
App42API.initialize("API_KEY","SECRET_KEY");
var pushNotificationService:PushNotificationService = App42API.buildPushNotificationService();
pushNotificationService.getUserSubscribedChannels(userName, max,offset, new callback());
class callback implements App42CallBack
{	
	public function onSuccess(response:Object):void
	{									
		var pushNotification:PushNotification = PushNotification(response);
		trace("User Name : "+pushNotification.getUserName());
		if(pushNotification.getChannelList().length > 0)
		{
			for(var j:int=0;j<pushNotification.getChannelList().length;j++)
			{
				trace("Channel Name  is : "+ Channel(pushNotification.getChannelList()[j]).getName());
			}
		}
	}
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
}	
Not Available
Coming Soon

Exception Handling

The functions available under Push Notification API can throw some exceptions in abnormal conditions. Example of the same has been given below.

E.g. If App developer is sending a message to channel which is not in database, the function will throw the App42Exception (as shown below) with message as “Not Found” and the appErrorCode as “1702” and the details as “Channel by the name ‘News Channel’ does not exist”.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String channelName = "News Channel";
String message = "Message which you have to send";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
pushNotificationService.sendPushMessageToChannel( channelName, message, new App42CallBack() {
public void onSuccess(Object response) 
{
	PushNotification pushNotification  = (PushNotification)response;
	System.out.println("Message is " + pushNotification.getMessage());  
	ArrayList<PushNotification.Channel> channelList = pushNotification.getChannelList();  
	for(PushNotification.Channel channelObj : channelList)  
	{  
		System.out.println("channelName is " + channelObj.getName());  
	} 
}
public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 1702)
	{
	// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
	}	
	else if(appErrorCode == 1401)
	{
	// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
	// handle here for Internal Server Error
	}	
	String jsonText = exception.getMessage(); 	
}    
});	                        
String channelName = "News Channel";
String message = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();  
pushNotificationService.SendPushMessageToChannel(channelName, message, new Callback());  
public class Callback : App42Callback  
{  
public void OnException(App42Exception exception)  
{  
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 1702)
	{
		// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
	}	
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}	
	String jsonText = exception.GetMessage(); 
}  
public void OnSuccess(Object response)  
{  
	PushNotification pushNotification = (PushNotification) response;
	String jsonResponse = pushNotification.ToString();  
}  
}  
	
NSString *channelName = @"News Channel";
NSString *message = @"Message which you have to send";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
PushNotificationService *pushNotificationService = [App42API buildPushService]; 
[pushNotificationService SendPushMessageToChannel:channelName withMessage:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		PushNotification *pushNotification =  (PushNotification*)responseObj;
		NSString *jsonResponse = [pushNotification toString]; 
	}
	else
	{ 
		int appErrorCode = exception.appErrorCode;
		int httpErrorCode = exception.httpErrorCode;
		if(appErrorCode == 1702)
		{
			// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
		}
		else if(appErrorCode  == 1705)
		{
			// Handle here for Not subscribed (User by the name '@userName' not subscribed for the channel '@channelName'.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		NSString *jsonText = exception.reason; 	
	}    
}];	
Not Available          
String channelName = "News Channel";
String message = "Message which you have to send";
App42API.initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.buildPushNotificationService(); 
try
{
	PushNotification pushNotification = pushNotificationService.sendPushMessageToChannel(channelName, message);
}
catch(App42Exception exception) 
{
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 1702)
	{
		// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
	}	
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}	
	String jsonText = exception.getMessage(); 	
}                   
String channelName = "News Channel";
String message = "Message which you have to send";
App42Log.SetDebug(true);        //Prints output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService();
pushNotificationService.SendPushMessageToChannel(channelName, message,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
	public void OnException(Exception ex)
	{
	    App42Exception  exception = (App42Exception)ex;
		int appErrorCode = exception.GetAppErrorCode();
    	int httpErrorCode = exception.GetHttpErrorCode();
		if(appErrorCode == 1702)
		{
			// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
		}	
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}	
		String jsonText = exception.GetMessage(); 
	}
	
	public void OnSuccess(object response)
	{  
		Avatar avatar = (Avatar) response;
		String jsonResponse = avatar.ToString();  
	}  
}
`
var channelName = "News Channel",
message = "Message which you have to send";
var appErrorCode ;
App42.initialize("API_KEY","SECRET_KEY");
var pushNotificationService  = new App42Push();
pushNotificationService.sendPushMessageToChannel(channelName, message,{
    success: function(object) {
    },
    error: function(error) 
    {
        var pushNotification = JSON.parse(object);  
        appErrorCode = pushNotification.app42Fault.appErrorCode;
        if(appErrorCode == 1702)
        {
            // Handle here for Not Found (Channel by the name '@channelName' does not exist.) not exist.)
        }
        else if(appErrorCode == 1401)
        {
            // handle here for Client is not authorized
        }
        else if(appErrorCode == 1500)
        {
            // handle here for Internal Server Error
        }
    }
});
Coming Soon
const char* channelName = "News Channel";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, message, app42callback(Sample_Class::onPushRequestCompleted, this));
void Sample_Class::onPushRequestCompleted(void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        //Handle success Response here
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
        int appErrorCode = pushResponse->appErrorCode;
        if(appErrorCode == 1702)
        {
            // Handle here for Not Found (Channel by the name '@channelName' does not exist.) not exist.)
        }
        else if(appErrorCode == 1401)
        {
            // handle here for Client is not authorized
        }
        else if(appErrorCode == 1500)
        {
            // handle here for Internal Server Error
        }
    }
}
String channelName = "News Channel";
String message = "Message which you have to send";
App42API.Initialize("API_KEY","SECRET_KEY");
PushNotificationService pushNotificationService = App42API.BuildPushnotificationService(); 
try
{
	PushNotification pushNotification = pushNotificationService.SendPushMessageToChannel(channelName, message);
}
catch(App42Exception exception) 
{
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 1702)
	{
		// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
	}	
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}	
	String jsonText = exception.GetMessage(); 	
}                       
$channelName = "News Channel";
$message = "Message which you have to send";
App42API::initialize("API_KEY","SECRET_KEY"); 
$pushNotificationService = App42API::buildPushNotificationService(); 
try
{
	$pushNotification = $pushNotificationService->sendPushMessageToChannel($channelName, $message);
}
catch(App42Exception $exception) 
{
	$appErrorCode = $exception->getAppErrorCode();
	$httpErrorCode = $exception->getHttpErrorCode();
	if($appErrorCode == 1702)
	{
		// Handle here for Not Found (Channel by the name '@channelName' does not exist.)
	}	
	else if($appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if($appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}	
	$jsonText = $exception->getMessage(); 	
}
const char* channelName = "News Channel";
const char* message = "Message which you have to send";
PushNotificationService::Initialize("API_KEY","SECRET_KEY");
PushNotificationService* pushNotificationService = PushNotificationService::getInstance();
pushService->SendPushMessageToChannel(channelName, message, this, app42callfuncND_selector(Sample_Class::onPushRequestCompleted));
void Sample_Class::onPushRequestCompleted(App42CallBack *sender, void *response)
{
    App42PushNotificationResponse *pushResponse = (App42PushNotificationResponse*)response;
    printf("\ncode=%d",pushResponse->getCode());
    printf("\nResponse Body=%s",pushResponse->getBody().c_str());
    if (pushResponse->isSuccess)
    {
        //Handle success Response here
    }
    else
    {
        printf("\nerrordetails:%s",pushResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",pushResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",pushResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",pushResponse->httpErrorCode);
        int appErrorCode = pushResponse->appErrorCode;
        if(appErrorCode == 1702)
        {
            // Handle here for Not Found (Channel by the name '@channelName' does not exist.) not exist.)
        }
        else if(appErrorCode == 1401)
        {
            // handle here for Client is not authorized
        }
        else if(appErrorCode == 1500)
        {
            // handle here for Internal Server Error
        }
    }
}
Coming Soon
Coming Soon 
Coming Soon
Coming Soon

Error Codes

Functions in PushNotification API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):

1400 - BAD REQUEST - The Request parameters are invalid. 1401 - UNAUTHORIZED - Client is not authorized. 1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again. 1700 - BAD REQUEST - User by the name '@userName' already registered with the device '@deviceToken'. 1701 - BAD REQUEST - Channel by the name '@channelName' already exist 1702 - NOT FOUND - Channel by the name '@channelName' does not exist. 1703 - NOT FOUND - User by the name '@userName' does not have any device registered 1704 - BAD REQUEST - User by the name '@userName' already subscribed for the channel '@channelName' 1705 - NOT FOUND - User by the name '@userName' not subscribed for any channel 1706 - NOT FOUND - No device is registered with the App 1707 - NOT FOUND - No device is Subscribed to the channel '@channelName'. 1708 - NOT FOUND - Channel by the name '@channelName' device '@deviceToken' does not subscribe. 1709 - NOT FOUND - User by the name '@userName' device token '@deviceToken' does not registered. 1710 - NOT FOUND - No device registered for user list '@userList' 1711 - NOT FOUND - No target user found for given query 1712 - NOT FOUND - In Active Users with date rnage '@startDate'and '@endDate' does not exist. 1713 - BAD REQUEST - User by the name '@userName' already unsubscribe with the device '@deviceToken' 1714 - BAD REQUEST - User by the name '@userName' already subscribe with the device '@deviceToken' 1715 - BAD REQUEST - Your previous request already in process.Please Try after sometime.