Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
75089115
Commit
75089115
authored
Oct 26, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化apns推送测试代码, apns 转base的代码
parent
7b13a0fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
bootstrap/src/test/java/io/geekidea/springbootplus/test/ApnsTest.java
+1
-1
bootstrap/src/test/java/io/geekidea/springbootplus/test/IosApnsBase64Test.java
+12
-5
No files found.
bootstrap/src/test/java/io/geekidea/springbootplus/test/ApnsTest.java
View file @
75089115
...
...
@@ -17,7 +17,7 @@ public class ApnsTest {
public
void
test
()
throws
Exception
{
File
file
=
new
File
(
"/Users/giaogiao/
Downloads/push_zixun
.p12"
);
File
file
=
new
File
(
"/Users/giaogiao/
Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/f31cd9e6d7da1d15c57c40575f5c85db/Message/MessageTemp/e1180914825140f051a87348bda5cbb5/File/hipro_test_push
.p12"
);
InputStream
certificate
=
new
FileInputStream
(
file
);
String
encode
=
Base64
.
encode
(
certificate
);
...
...
bootstrap/src/test/java/io/geekidea/springbootplus/test/IosApnsBase64Test.java
View file @
75089115
...
...
@@ -6,6 +6,8 @@ import com.turo.pushy.apns.PushType;
import
com.wecloud.im.ws.sender.IosPush
;
import
java.io.ByteArrayInputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.HashMap
;
...
...
@@ -29,17 +31,22 @@ public class IosApnsBase64Test {
// * @param sound rtc= "call.caf"; 否则为default
Map
<
String
,
Object
>
customProperty
=
new
HashMap
<
String
,
Object
>(
10
);
String
apnsCertificatePath
=
"frogsell_push_dev.p12"
;
String
deviceToken
=
"
27c93ca84bbf17d9ff8eb05df0576ac49822db2ae1c02aa0afea83b5c3861276
"
;
//
String apnsCertificatePath = "frogsell_push_dev.p12";
String
deviceToken
=
"
5b761f954efe7493de0bc751942e1a8355853771b66a512f5687ca05e7335e99
"
;
String
alertTitle
=
"你好333"
;
String
alertBody
=
"hi333"
;
int
badge
=
1
;
String
topicBundleId
=
"com.
jdw.frogsell
"
;
String
topicBundleId
=
"com.
xteng.Hibro
"
;
boolean
contentAvailable
=
false
;
InputStream
certificate
=
IosPush
.
getApnsCertificate
(
apnsCertificatePath
);
String
encode
=
Base64
.
encode
(
certificate
);
// InputStream certificate = IosPush.getApnsCertificate(apnsCertificatePath);
// String encode = Base64.encode(certificate);
File
file
=
new
File
(
"/Users/giaogiao/Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/f31cd9e6d7da1d15c57c40575f5c85db/Message/MessageTemp/e1180914825140f051a87348bda5cbb5/File/hipro_test_push.p12"
);
InputStream
in
=
new
FileInputStream
(
file
);
String
encode
=
Base64
.
encode
(
in
);
// 解码
byte
[]
decode
=
Base64
.
decode
(
encode
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment