Commit e299ec07 by giaogiao

优化APNS推送配置正式或测试环境

parent f630176a
...@@ -12,7 +12,7 @@ public class IosApnsPushTest { ...@@ -12,7 +12,7 @@ public class IosApnsPushTest {
public static void main(String[] args) { public static void main(String[] args) {
// * @param apnsCertificatePath 证书 // * @param apnsCertificatePath 证书
// * @param productFlag 环境 // * @param productFlag 环境,测试=Boolean.FALSE,正式=Boolean.TRUE
// * @param deviceToken 设备token // * @param deviceToken 设备token
// * @param alertTitle 标题 // * @param alertTitle 标题
// * @param alertBody 副标题 // * @param alertBody 副标题
......
...@@ -67,7 +67,7 @@ public class IosPush { ...@@ -67,7 +67,7 @@ public class IosPush {
/** /**
* @param inputStream 证书输入流 * @param inputStream 证书输入流
* @param productFlag 环境 * @param productFlag 环境,测试=Boolean.FALSE,正式=Boolean.TRUE
* @param deviceToken 设备token * @param deviceToken 设备token
* @param alertTitle 标题 * @param alertTitle 标题
* @param alertBody 副标题 * @param alertBody 副标题
......
...@@ -216,7 +216,16 @@ public class PushTask { ...@@ -216,7 +216,16 @@ public class PushTask {
// 解码 // 解码
byte[] decode = Base64.decode(apns.getApnsFileValue()); byte[] decode = Base64.decode(apns.getApnsFileValue());
InputStream inputStream2 = new ByteArrayInputStream(decode); InputStream inputStream2 = new ByteArrayInputStream(decode);
IosPush.push(certificatePassword, inputStream2, Boolean.FALSE, deviceToken, alertTitle, alertBody,
// productFlag 环境,测试=Boolean.FALSE,正式=Boolean.TRUE
Boolean productFlag = Boolean.FALSE;
// 正式1,测试0
if (apns.getEnv() == 1) {
productFlag = Boolean.TRUE;
}
IosPush.push(certificatePassword, inputStream2, productFlag, deviceToken, alertTitle, alertBody,
contentAvailable, customProperty, badge contentAvailable, customProperty, badge
, DeliveryPriority.IMMEDIATE, PushType.ALERT, topicBundleId, , DeliveryPriority.IMMEDIATE, PushType.ALERT, topicBundleId,
sound); sound);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment