`
knight_black_bob
  • 浏览: 824101 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

javapns IOS推送

    博客分类:
  • apns
 
阅读更多

javapns IOS推送

package javapns.test;

import java.util.*;

import javapns.*;
import javapns.communication.exceptions.*;
import javapns.devices.*;

/**
 * A command-line test facility for the Feedback Service.
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.FeedbackTest keystore.p12 mypass</code></p>
 * 
 * <p>By default, this test uses the sandbox service.  To switch, add "production" as a third parameter:</p>
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.FeedbackTest keystore.p12 mypass production</code></p>
 * 
 * @author Sylvain Pedneault
 */
public class FeedbackTest extends TestFoundation {

	/**
	 * Execute this class from the command line to run tests.
	 * 
	 * @param args
	 */
	public static void main(String[] args) {

		/* Verify that the test is being invoked  */
		if (!verifyCorrectUsage(FeedbackTest.class, args, "keystore-path", "keystore-password", "[production|sandbox]")) return;

		/* Initialize Log4j to print logs to console */
		configureBasicLogging();

		/* Get a list of inactive devices */
		feedbackTest(args);
	}


	private FeedbackTest() {
	}


	/**
	 * Retrieves a list of inactive devices from the Feedback service.
	 * @param args
	 */
	private static void feedbackTest(String[] args) {
		String keystore = args[0];
		String password = args[1];
		boolean production = args.length >= 3 ? args[2].equalsIgnoreCase("production") : false;
		try {
			List<Device> devices = Push.feedback(keystore, password, production);

			for (Device device : devices) {
				System.out.println("Inactive device: " + device.getToken());
			}
		} catch (CommunicationException e) {
			e.printStackTrace();
		} catch (KeystoreException e) {
			e.printStackTrace();
		}
	}

}

 

 

package javapns.test;

import java.util.*;

import javapns.*;
import javapns.communication.exceptions.*;
import javapns.devices.*;
import javapns.devices.implementations.basic.*;
import javapns.notification.*;
import javapns.notification.transmission.*;

import org.json.*;

/**
 * A command-line test facility for the Push Notification Service.
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4</code></p>
 * 
 * <p>By default, this test uses the sandbox service.  To switch, add "production" as a fourth parameter:</p>
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 production</code></p>
 * 
 * <p>Also by default, this test pushes a simple alert.  To send a complex payload, add "complex" as a fifth parameter:</p>
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 production complex</code></p>
 * 
 * <p>To send a simple payload to a large number of fake devices, add "threads" as a fifth parameter, the number of fake devices to construct, and the number of threads to use:</p>
 * <p>Example:  <code>java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 sandbox threads 1000 5</code></p>
 * 
 * @author Sylvain Pedneault
 */
public class NotificationTest extends TestFoundation {

	/**
	 * Execute this class from the command line to run tests.
	 * 
	 * @param args
	 */
	public static void main(String[] args) {

		/* Verify that the test is being invoked  */
		if (!verifyCorrectUsage(NotificationTest.class, args, "keystore-path", "keystore-password", "device-token", "[production|sandbox]", "[complex|simple|threads]", "[#devices]", "[#threads]")) return;

		/* Initialize Log4j to print logs to console */
		configureBasicLogging();

		/* Push an alert */
		try {
			pushTest(args);
		} catch (CommunicationException e) {
			e.printStackTrace();
		} catch (KeystoreException e) {
			e.printStackTrace();
		}
	}


	private NotificationTest() {
	}


	/**
	 * Push a test notification to a device, given command-line parameters.
	 * 
	 * @param args
	 * @throws KeystoreException 
	 * @throws CommunicationException 
	 */
	private static void pushTest(String[] args) throws CommunicationException, KeystoreException {
		String keystore = args[0];
		String password = args[1];
		String token = args[2];
		boolean production = args.length >= 4 ? args[3].equalsIgnoreCase("production") : false;
		boolean simulation = args.length >= 4 ? args[3].equalsIgnoreCase("simulation") : false;
		boolean complex = args.length >= 5 ? args[4].equalsIgnoreCase("complex") : false;
		boolean threads = args.length >= 5 ? args[4].equalsIgnoreCase("threads") : false;
		int threadDevices = args.length >= 6 ? Integer.parseInt(args[5]) : 100;
		int threadThreads = args.length >= 7 ? Integer.parseInt(args[6]) : 10;
		boolean simple = !complex && !threads;

		verifyKeystore(keystore, password, production);

		if (simple) {

			/* Push a test alert */
			List<PushedNotification> notifications = Push.test(keystore, password, production, token);
			printPushedNotifications(notifications);

		} else if (complex) {

			/* Push a more complex payload */
			List<PushedNotification> notifications = Push.payload(createComplexPayload(), keystore, password, production, token);
			printPushedNotifications(notifications);

		} else if (threads) {

			/* Push a Hello World! alert repetitively using NotificationThreads */
			pushSimplePayloadUsingThreads(keystore, password, production, token, simulation, threadDevices, threadThreads);

		}
	}


	/**
	 * Create a complex payload for test purposes.
	 * @return
	 */
	@SuppressWarnings("unchecked")
	private static Payload createComplexPayload() {
		PushNotificationPayload complexPayload = PushNotificationPayload.complex();
		try {
			// You can use addBody to add simple message, but we'll use
			// a more complex alert message so let's comment it
			complexPayload.addCustomAlertBody("My alert message");
			complexPayload.addCustomAlertActionLocKey("Open App");
			complexPayload.addCustomAlertLocKey("javapns rocks %@ %@%@");
			ArrayList parameters = new ArrayList();
			parameters.add("Test1");
			parameters.add("Test");
			parameters.add(2);
			complexPayload.addCustomAlertLocArgs(parameters);
			complexPayload.addBadge(45);
			complexPayload.addSound("default");
			complexPayload.addCustomDictionary("acme", "foo");
			complexPayload.addCustomDictionary("acme2", 42);
			ArrayList values = new ArrayList();
			values.add("value1");
			values.add(2);
			complexPayload.addCustomDictionary("acme3", values);
		} catch (JSONException e) {
			System.out.println("Error creating complex payload:");
			e.printStackTrace();
		}
		return complexPayload;
	}


	protected static void pushSimplePayloadUsingThreads(String keystore, String password, boolean production, String token, boolean simulation, int devices, int threads) {
		try {

			System.out.println("Creating PushNotificationManager and AppleNotificationServer");
			AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
			System.out.println("Creating payload (simulation mode)");
			//			Payload payload = PushNotificationPayload.alert("Hello World!");
			Payload payload = PushNotificationPayload.test();

			System.out.println("Generating " + devices + " fake devices");
			List<Device> deviceList = new ArrayList<Device>(devices);
			for (int i = 0; i < devices; i++) {
				String tokenToUse = token;
				if (tokenToUse == null || tokenToUse.length() != 64) {
					tokenToUse = "123456789012345678901234567890123456789012345678901234567" + (1000000 + i);
				}
				deviceList.add(new BasicDevice(tokenToUse));
			}

			System.out.println("Creating " + threads + " notification threads");
			NotificationThreads work = new NotificationThreads(server, simulation ? payload.asSimulationOnly() : payload, deviceList, threads);
			//work.setMaxNotificationsPerConnection(10000);
			System.out.println("Linking notification work debugging listener");
			work.setListener(DEBUGGING_PROGRESS_LISTENER);

			System.out.println("Starting all threads...");
			long timestamp1 = System.currentTimeMillis();
			work.start();
			System.out.println("All threads started, waiting for them...");
			work.waitForAllThreads();
			long timestamp2 = System.currentTimeMillis();
			System.out.println("All threads finished in " + (timestamp2 - timestamp1) + " milliseconds");

			printPushedNotifications(work.getPushedNotifications());

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * A NotificationProgressListener you can use to debug NotificationThreads.
	 */
	public static final NotificationProgressListener DEBUGGING_PROGRESS_LISTENER = new NotificationProgressListener() {

		public void eventThreadStarted(NotificationThread notificationThread) {
			System.out.println("   [EVENT]: thread #" + notificationThread.getThreadNumber() + " started with " + notificationThread.getDevices().size() + " devices beginning at message id #" + notificationThread.getFirstMessageIdentifier());
		}


		public void eventThreadFinished(NotificationThread thread) {
			System.out.println("   [EVENT]: thread #" + thread.getThreadNumber() + " finished: pushed messages #" + thread.getFirstMessageIdentifier() + " to " + thread.getLastMessageIdentifier() + " toward " + thread.getDevices().size() + " devices");
		}


		public void eventConnectionRestarted(NotificationThread thread) {
			System.out.println("   [EVENT]: connection restarted in thread #" + thread.getThreadNumber() + " because it reached " + thread.getMaxNotificationsPerConnection() + " notifications per connection");
		}


		public void eventAllThreadsStarted(NotificationThreads notificationThreads) {
			System.out.println("   [EVENT]: all threads started: " + notificationThreads.getThreads().size());
		}


		public void eventAllThreadsFinished(NotificationThreads notificationThreads) {
			System.out.println("   [EVENT]: all threads finished: " + notificationThreads.getThreads().size());
		}


		public void eventCriticalException(NotificationThread notificationThread, Exception exception) {
			System.out.println("   [EVENT]: critical exception occurred: " + exception);
		}
	};


	/**
	 * Print to the console a comprehensive report of all pushed notifications and results.
	 * @param notifications a raw list of pushed notifications
	 */
	public static void printPushedNotifications(List<PushedNotification> notifications) {
		List<PushedNotification> failedNotifications = PushedNotification.findFailedNotifications(notifications);
		List<PushedNotification> successfulNotifications = PushedNotification.findSuccessfulNotifications(notifications);
		int failed = failedNotifications.size();
		int successful = successfulNotifications.size();

		if (successful > 0 && failed == 0) {
			printPushedNotifications("All notifications pushed successfully (" + successfulNotifications.size() + "):", successfulNotifications);
		} else if (successful == 0 && failed > 0) {
			printPushedNotifications("All notifications failed (" + failedNotifications.size() + "):", failedNotifications);
		} else if (successful == 0 && failed == 0) {
			System.out.println("No notifications could be sent, probably because of a critical error");
		} else {
			printPushedNotifications("Some notifications failed (" + failedNotifications.size() + "):", failedNotifications);
			printPushedNotifications("Others succeeded (" + successfulNotifications.size() + "):", successfulNotifications);
		}
	}


	/**
	 * Print to the console a list of pushed notifications.
	 * @param description a title for this list of notifications
	 * @param notifications a list of pushed notifications to print
	 */
	public static void printPushedNotifications(String description, List<PushedNotification> notifications) {
		System.out.println(description);
		for (PushedNotification notification : notifications) {
			try {
				System.out.println("  " + notification.toString());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}

 

 

 

package javapns.test;

import java.io.*;
import java.util.*;

import javapns.*;
import javapns.communication.exceptions.*;
import javapns.devices.*;
import javapns.devices.implementations.basic.*;
import javapns.notification.*;
import javapns.notification.transmission.*;

import org.json.*;

/**
 * Specific test cases intended for the project's developers.
 * 
 * @author Sylvain Pedneault
 */
public class SpecificNotificationTests extends TestFoundation {

	/**
	 * Execute this class from the command line to run tests.
	 * 
	 * @param args
	 */
	public static void main(String[] args) {

		/* Verify that the test is being invoked  */
		if (!verifyCorrectUsage(NotificationTest.class, args, "keystore-path", "keystore-password", "device-token", "[production|sandbox]", "[test-name]")) return;

		/* Initialize Log4j to print logs to console */
		configureBasicLogging();

		/* Push an alert */
		runTest(args);
	}


	private SpecificNotificationTests() {
	}


	/**
	 * Push a test notification to a device, given command-line parameters.
	 * 
	 * @param args
	 */
	private static void runTest(String[] args) {
		String keystore = args[0];
		String password = args[1];
		String token = args[2];
		boolean production = args.length >= 4 ? args[3].equalsIgnoreCase("production") : false;
		boolean simulation = args.length >= 4 ? args[3].equalsIgnoreCase("simulation") : false;

		String testName = args.length >= 5 ? args[4] : null;
		if (testName == null || testName.length() == 0) testName = "default";

		try {
			SpecificNotificationTests.class.getDeclaredMethod("test_" + testName, String.class, String.class, String.class, boolean.class).invoke(null, keystore, password, token, production);
		} catch (NoSuchMethodException e) {
			System.out.println(String.format("Error: test '%s' not found.  Test names are case-sensitive", testName));
		} catch (Exception e) {
			(e.getCause() != null ? e.getCause() : e).printStackTrace();
		}
	}


	private static void test_PushHelloWorld(String keystore, String password, String token, boolean production) throws CommunicationException, KeystoreException {
		List<PushedNotification> notifications = Push.alert("Hello World!", keystore, password, production, token);
		NotificationTest.printPushedNotifications(notifications);
	}


	private static void test_Issue74(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("");
			System.out.println("TESTING 257-BYTES PAYLOAD WITH SIZE ESTIMATION ENABLED");
			/* Expected result: PayloadMaxSizeProbablyExceededException when the alert is added to the payload */
			pushSpecificPayloadSize(keystore, password, token, production, true, 257);
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			System.out.println("");
			System.out.println("TESTING 257-BYTES PAYLOAD WITH SIZE ESTIMATION DISABLED");
			/* Expected result: PayloadMaxSizeExceededException when the payload is pushed */
			pushSpecificPayloadSize(keystore, password, token, production, false, 257);
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			System.out.println("");
			System.out.println("TESTING 256-BYTES PAYLOAD");
			/* Expected result: no exception */
			pushSpecificPayloadSize(keystore, password, token, production, false, 256);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue75(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("");
			System.out.println("TESTING 257-BYTES PAYLOAD WITH SIZE ESTIMATION ENABLED");
			NewsstandNotificationPayload payload = NewsstandNotificationPayload.contentAvailable();
			debugPayload(payload);

			List<PushedNotification> notifications = Push.payload(payload, keystore, password, production, token);
			NotificationTest.printPushedNotifications(notifications);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue82(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("");
			Payload payload = PushNotificationPayload.test();

			System.out.println("TESTING ISSUE #82 PART 1");
			List<PushedNotification> notifications = Push.payload(payload, keystore, password, production, 1, token);
			NotificationTest.printPushedNotifications(notifications);
			System.out.println("ISSUE #82 PART 1 TESTED");

			System.out.println("TESTING ISSUE #82 PART2");
			AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
			NotificationThread thread = new NotificationThread(new PushNotificationManager(), server, payload, token);
			thread.setListener(NotificationTest.DEBUGGING_PROGRESS_LISTENER);
			thread.start();
			System.out.println("ISSUE #82 PART 2 TESTED");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue87(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("TESTING ISSUES #87 AND #88");

			InputStream ks = new BufferedInputStream(new FileInputStream(keystore));
			PushQueue queue = Push.queue(ks, password, false, 3);
			queue.start();
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			Thread.sleep(10000);
			List<Exception> criticalExceptions = queue.getCriticalExceptions();
			for (Exception exception : criticalExceptions) {
				exception.printStackTrace();
			}
			Thread.sleep(10000);

			List<PushedNotification> pushedNotifications = queue.getPushedNotifications();
			NotificationTest.printPushedNotifications("BEFORE CLEAR:", pushedNotifications);

			queue.clearPushedNotifications();

			pushedNotifications = queue.getPushedNotifications();
			NotificationTest.printPushedNotifications("AFTER CLEAR:", pushedNotifications);

			Thread.sleep(50000);
			System.out.println("ISSUES #87 AND #88 TESTED");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue88(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("TESTING ISSUES #88");

			//			List<String> devices = new Vector<String>();
			//			for (int i = 0; i < 5; i++) {
			//				devices.add(token);
			//			}
			//			PushedNotifications notifications = Push.payload(PushNotificationPayload.test(), keystore, password, false, devices);
			PushQueue queue = Push.queue(keystore, password, false, 1);
			queue.start();
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			queue.add(PushNotificationPayload.test(), token);
			Thread.sleep(10000);

			PushedNotifications notifications = queue.getPushedNotifications();
			NotificationTest.printPushedNotifications(notifications);

			Thread.sleep(5000);
			System.out.println("ISSUES #88 TESTED");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue99(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("");
			System.out.println("TESTING ISSUE #99");
			PushNotificationPayload payload = PushNotificationPayload.complex();
			payload.addCustomAlertBody("Hello World!");
			payload.addCustomAlertActionLocKey(null);
			debugPayload(payload);

			List<PushedNotification> notifications = Push.payload(payload, keystore, password, production, token);
			NotificationTest.printPushedNotifications(notifications);
			System.out.println("ISSUE #99 TESTED");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_Issue102(String keystore, String password, String token, boolean production) {
		try {
			System.out.println("");
			System.out.println("TESTING ISSUE #102");
			int devices = 10000;
			int threads = 20;
			boolean simulation = false;
			String realToken = token;
			token = null;

			try {

				System.out.println("Creating PushNotificationManager and AppleNotificationServer");
				AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
				System.out.println("Creating payload (simulation mode)");
				//Payload payload = PushNotificationPayload.alert("Hello World!");
				Payload payload = PushNotificationPayload.test();

				System.out.println("Generating " + devices + " fake devices");
				List<Device> deviceList = new ArrayList<Device>(devices);
				for (int i = 0; i < devices; i++) {
					String tokenToUse = token;
					if (tokenToUse == null || tokenToUse.length() != 64) {
						tokenToUse = "123456789012345678901234567890123456789012345678901234567" + (1000000 + i);
					}
					deviceList.add(new BasicDevice(tokenToUse));
				}
				deviceList.add(new BasicDevice(realToken));
				System.out.println("Creating " + threads + " notification threads");
				NotificationThreads work = new NotificationThreads(server, simulation ? payload.asSimulationOnly() : payload, deviceList, threads);
				//work.setMaxNotificationsPerConnection(10000);
				//System.out.println("Linking notification work debugging listener");
				//work.setListener(DEBUGGING_PROGRESS_LISTENER);

				System.out.println("Starting all threads...");
				long timestamp1 = System.currentTimeMillis();
				work.start();
				System.out.println("All threads started, waiting for them...");
				work.waitForAllThreads();
				long timestamp2 = System.currentTimeMillis();
				System.out.println("All threads finished in " + (timestamp2 - timestamp1) + " milliseconds");

				NotificationTest.printPushedNotifications(work.getSuccessfulNotifications());

			} catch (Exception e) {
				e.printStackTrace();
			}

			//			List<PushedNotification> notifications = Push.payload(payload, keystore, password, production, token);
			//			NotificationTest.printPushedNotifications(notifications);
			System.out.println("ISSUE #102 TESTED");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void test_ThreadPoolFeature(String keystore, String password, String token, boolean production) throws Exception {
		try {
			System.out.println("");
			System.out.println("TESTING THREAD POOL FEATURE");

			AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
			NotificationThreads pool = new NotificationThreads(server, 3).start();
			Device device = new BasicDevice(token);

			System.out.println("Thread pool started and waiting...");

			System.out.println("Sleeping 5 seconds before queuing payloads...");
			Thread.sleep(5 * 1000);

			for (int i = 1; i <= 4; i++) {
				Payload payload = PushNotificationPayload.alert("Test " + i);
				NotificationThread threadForPayload = (NotificationThread) pool.add(new PayloadPerDevice(payload, device));
				System.out.println("Queued payload " + i + " to " + threadForPayload.getThreadNumber());
				System.out.println("Sleeping 10 seconds before queuing another payload...");
				Thread.sleep(10 * 1000);
			}
			System.out.println("Sleeping 10 more seconds let threads enough times to push the latest payload...");
			Thread.sleep(10 * 1000);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private static void pushSpecificPayloadSize(String keystore, String password, String token, boolean production, boolean checkWhenAdding, int targetPayloadSize) throws CommunicationException, KeystoreException, JSONException {
		StringBuilder buf = new StringBuilder();
		for (int i = 0; i < targetPayloadSize - 20; i++)
			buf.append('x');

		String alertMessage = buf.toString();
		PushNotificationPayload payload = PushNotificationPayload.complex();
		if (checkWhenAdding) payload.setPayloadSizeEstimatedWhenAdding(true);
		debugPayload(payload);

		boolean estimateValid = payload.isEstimatedPayloadSizeAllowedAfterAdding("alert", alertMessage);
		System.out.println("Payload size estimated to be allowed: " + (estimateValid ? "yes" : "no"));
		payload.addAlert(alertMessage);
		debugPayload(payload);

		List<PushedNotification> notifications = Push.payload(payload, keystore, password, production, token);
		NotificationTest.printPushedNotifications(notifications);
	}


	private static void debugPayload(Payload payload) {
		System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
		try {
			System.out.println("Payload size: " + payload.getPayloadSize());
		} catch (Exception e) {
		}
		try {
			System.out.println("Payload representation: " + payload);
		} catch (Exception e) {
		}
		System.out.println(payload.isPayloadSizeEstimatedWhenAdding() ? "Payload size is estimated when adding properties" : "Payload size is only checked when it is complete");
		System.out.println("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv");
	}

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。



 
 
 谢谢您的赞助,我会做的更好!

 

 

分享到:
评论

相关推荐

    JAVA IOS推送 javaPNS2.2与javaPNS2.2.1

    JAVA的IOS推送。目前项目中正在用的,绝对可用

    java实现IOS推送

    java实现IOS推送 运用javapns 包含包和基本的数据库配置

    IOS消息推送服务端开发

    IOS消息推送机制 ios消息推送主要主流有两种方式,一种是基于javaapns.jar和javaPNS.jar的开源的消息推送,javaPNS.jar支持多线程。

    IOS推送JAVA服务端文档

    IOS推送JAVA服务端文档,javaPNS2.2

    IOS推送教程

    很详细的IOS推送教程,看了就会,里面还有示范代码,需要下载JAVAPNS2.2.jar。

    JAVA IOS消息推送依赖jar

    IOS Java实现消息推送(APNS),包含bcprov-jdk15on-149.jar、javapns-jdk16-163.jar

    testpush:maven安装 javapns demo iOS推送java jersey服务器

    #testpush ##开发工具 下载 , ##maven配置 下载了lastest version,文件名:apache-maven-3.2.1-bin.tar.gz 将解压在当前目录下。 将解压后的apache-maven-3.2.1文件夹移到/usr/local/maven目录(不存在则新建)下...

    java向Iphone(IOS)推送jar包

    java向Iphone(IOS)推送相关的五个jar包,分别是bcprov-jdk16-145.jar,commons-io-2.0.1.jar,commons-lang-2.1.jar,javapns-jdk16-163.jar, log4j-1.2.12.jar

    java进行苹果APNS消息推送

    java实现苹果推送 里面有两个方法实现推送

    ios-pn java消息推送

    第一阶段:Push服务器应用程序把要发送的消息、目的iPhone的标识打包,发给APNS。 第二阶段:APNS在自身的已注册Push服务的... 第三阶段:iPhone把发来的消息传递给相应的应用程序, 并且按照设定弹出Push通知。

    iOS消息推送

    import javapns.data.Device; import javapns.data.PayLoad; import org.apache.log4j.Logger; import org.apache.commons.lang.StringUtils; import javapns.back.SSLConnectionHelper; import javapns.back....

    Java 做推送所用的5个jar文件

    IOS推送消息(java实现) 需要用到的jar包 bcprov-jdk16-145-1.jar commons-io-2.0.1.jar commons-lang-2.5.jar javapns-jdk16-163.jar log4j-1.2.16.jar

    ios信息推送的5个jar

    bcprov-jdk16-145-1.jar,commons-io-2.0.1.jar commons-lang-2.5.jar,JavaPNS_2.2.jar,log4j-1.2.16.jar

    javapns-jdk

    java后台用的,给ios设备推送,估计会用到吧!! javapns-jdk16-163

    JavaPNS_2.2

    JavaPNS JavaPNS_2.2 jar包及文档.java推送ios苹果服务器javaPns2.2.jar 免资源分共享下载

    IOS PUSH DEMO

    java ios推送 jar:javapns-jdk16-163.jar,bcprov-jdk16-145.jar

    iOS 点击推送消息跳到应用指定页面的实例

    iOS 点击推送消息跳到应用指定页面 现在的推送用的越来越频繁,几乎每个应用都开始用到了。其实又有几个用户会去看推送消息呢?没办法,产品经理最大啊,只是苦了我们这一帮程序员啊!闲话少说,进入正题。兄弟我用...

    javapns-jdk16-163.jar

    ios手机推送信息关键服务器jar包,这是用于连接iphone提供的服务器推送消息。

    PushNotificationPayload jar包

    IOS推送APNS必须的三个包,PushNotificationPayload,PushNotificationManager,PushedNotification,AppleNotificationServerBasicImpl;包含bcprov-jdk16-145-1.jar,JavaPNS_2.2.jar,javapns-jdk16-163.jar;

    java推荐IOS消息包含所有包

    IOS消息java服务端推送,包含所涉及到的所有 jar 包

Global site tag (gtag.js) - Google Analytics