From e59883442c86975a80acc5e467ade2c5d422fa61 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 12 Apr 2019 10:42:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20app=E6=8E=A8=E9=80=81=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/pushMessage/APNSMessageHelper.java | 10 ++++++---- .../resources/apple_message_cert_product.p12 | Bin 3185 -> 0 bytes .../apple_message_cert_product20180413.p12 | Bin 3325 -> 0 bytes 3 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 src/main/resources/apple_message_cert_product.p12 delete mode 100644 src/main/resources/apple_message_cert_product20180413.p12 diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java index 3dffffcd3..781fc0776 100644 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java +++ b/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java @@ -9,6 +9,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -21,14 +23,14 @@ public class APNSMessageHelper { @Value("classpath:apple_message_cert_dev.p12") private org.springframework.core.io.Resource appleMessageFileDev; - @Value("classpath:apple_message_cert_product.p12") - private org.springframework.core.io.Resource appleMessageFileProduct; + @Value("${apple.message.apns.file}") + private String appleApnsFile; @Value("${apple.message.apns.password}") private String appleMessagePassword; public void sendAppleMessage(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { /**设置参数,发送数据**/ - InputStream keyIns = appleMessageFileProduct.getInputStream(); + InputStream keyIns = new FileInputStream(new File(appleApnsFile)); ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build(); service.push(token, payload); @@ -37,7 +39,7 @@ public class APNSMessageHelper { public void sendAppleMessageDetail(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { /**设置参数,发送数据**/ - InputStream keyIns = appleMessageFileProduct.getInputStream(); + InputStream keyIns = new FileInputStream(new File(appleApnsFile)); ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build(); service.push(token, payload); diff --git a/src/main/resources/apple_message_cert_product.p12 b/src/main/resources/apple_message_cert_product.p12 deleted file mode 100644 index 905e2cc1f9a781dadadea431f38b687ef7fc156c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3185 zcmY+FcQhM}zs4JqGjccTJO!}0V|U>XsECgGR?a2b$`rxyg` z>G}R*Za5y?{%-}&#e-}9qDm^jrN2@1Zv%jHfocDHfgS*cGXf!HiE0Xk`G;dvRFF%d zc(A`_nLYQ`jmUuUTxbn@l&v}x&tO^K#}#o4nAb@&!44-DijElrUcs7jw{oS2_MLXY zn=9nY4_X+(d80+CW^dndlo4z}CL1HV+qNlPwKi86H6@+DL4i3k*RbE@T={gH!q%Q~ z+D*8sY%evU(gp=^8^x%Vb|VeF8KmoK3vYE>^GQOLKfpfXIA@mM{-aXub+Za=@C^{RH zVNqd*;L)mHNZ;%gs&#uZ(|y8N#4@{A&u9w`w9@FTRxtq#tSdxJK|W~(em8Yic<1Q$ zBhQ&lZ2R=N`0nqV28aX9{^#CS#I%!P8=1UDKlDicbEuXpqcOXtgxqyHEo<$PH!S(Y zj&i5a5fu=r&p!2e>hG10q^t0?1jO%AuP<~nOK+4VSrlOWrTZJdK8S6wGF|-uV@|K< z(O;XWVIKy%Ghj7O$8jBaW4#@MD0Tl#mS32=&WR_M*oTvo-9`EZ@UpW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it8hOWyu4$kNhQH^l2ZW5j OgM9UD2OCoX0RIJhlkN%t diff --git a/src/main/resources/apple_message_cert_product20180413.p12 b/src/main/resources/apple_message_cert_product20180413.p12 deleted file mode 100644 index 58c694512551af6a89e5da57a0a8b813564227e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3325 zcmY+FbyyROx5pWbQ3FQF=t=iRy-19fmXZ*hl*ptc9H}4-hNR#S5L8lH7$V9Dm6lMt zQ@SJsHbCn7d!Bpmd+#6Toagy`&vX7f9|RVBLJ6QkV8P8GI>}hW*ds;&4ImE-eh~K--mIumq0Gj2Mqj2c1$@$QlVs8$sE3y%VuA*n6nQyLEYoTEojpt3S$bj@v ztx`7luSmV0S5W`F_E_A;$6djk>oVOlVXzJY$+=4gxov6xY_zhi9KRklCJOaP@l-kCf%E>P2Q*&FF;Q=zBj`%M>pSWN#V)WnY<3x&~9D?ehXx z;*&wXN>*u-#ov2vWOuz~cMHSuHL!KT5FA2b7{V8KGvj+cS~N!1SOeB2o(NG|nZsf} zWo60DP|aVBzU2(w>V*XiV1-;N_a|ArE!*Z}Ny0jDGW>SRQ_q}ioscdZ>?m;-6oY!E zG8k?29?r%MlU;j&PM&b&9Y{`%5&EGv!r|6T28mYjKz0(juh*Li+xG*EDqcdvQ^J@~qBe>_Kp_gAd@3tq*pEyDJ&Q(b~*0_bXv7;NG zu=n=Sp;B6>irV#5zUZG(f;jK2^R2iVf=C?%$GP1}k)})k+A(8+L(*fbn?fe16QLMo z8+x!6>t9ZIR%K2Yw(imB#qvn@{c-}I)9^^!H=AGFM{e1CFv4l2@!~JHP>C%|3~a{b|zYQ_kZTC`(ox<11&pjM~jXs6n;RO3YC(DQbR13PIa?uyR` zuDV~3CtRW9Th+MSKrQf zVLJyska(4B?l>@H8AGj*$w9&Y7%Go$)WuZj@gE$Y<4+2aO&V>*fv?M-m^El?j55xi z!esEv_qAJ|nsc6Sdbt!3xP+(!sNy>v^}UE~Ma{XyP%VFyYmwP$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