public class apnsTest {
private ApnsService apnsService;
@Before
public void init(){
ApnsConfig apnsConfig = new ApnsConfig();
//apnsConfig.setDevEnv(PushConfig.apnsProduction);
apnsConfig.setKeyStorePath("APNS.p12");
apnsConfig.setPassword("");
apnsConfig.setDevEnv(true);
apnsService = new NettyApnsService(apnsConfig);
}
@Test
public void sendNotification() throws Exception {
String token = "sFsDgPKihHrfM02eDNsXxcBd0pJ0KQYn6H60IUYZWFM=";
token = Hex.encodeHexString(Base64.decodeBase64(token));
Payload payload = new Payload();
payload.setAlert("How are you?");
payload.setBadge(Integer.valueOf(1));
apnsService.sendNotification(token, payload);
Thread.sleep(800000);
}
}
diaozxin007/Netty-apns
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
init
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published