Comments (7)
Sorry about that.
from apns-http2.
This is most likely because you haven't put in the ALPN JAR in your boot classpath. Please see #28.
from apns-http2.
I have the same issue , when I using provider authentication tokens, here is my code:
@test
public void testAPNsHttp2Sync() throws UnrecoverableKeyException, KeyManagementException, CertificateException,
NoSuchAlgorithmException, KeyStoreException, IOException {
// Using provider authentication tokens
final ApnsClient client = new ApnsClientBuilder()
.inSynchronousMode()
.withProductionGateway()
.withApnsAuthKey("-----BEGIN PRIVATE KEY-----MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgjZTdQgZM/8AQspuD9G7aTsQTEBqomiu4TJ0LxU5gaI+gCgYIKoZIzj0DAQehRANCAASbKaMLxR56q2N0oQ8YXcOFEhHL7cAuNcLUwkMTLplUKoaRzSY9Me85UnjtuMxjmYpFkbmYtFtrNULzedlBXk/K-----END PRIVATE KEY-----")
.withTeamID("4S5ZWGJSPN")
.withKeyID("CPPMHRM7CC")
//.withDefaultTopic("<your app's topic>")
.build();
// Build your notification
Notification n = new Notification.Builder("4f872918800d5010c332ad3e0e68cc040d2979d3db7fedc20f0e98bc70235556").alertBody("Hello").build();
// Send the notification
// Synchronous
NotificationResponse result = client.push(n);
System.out.println(result);
}
and this is the error:
java.lang.IllegalArgumentException: Illegal base64 character 2d
at java.util.Base64$Decoder.decode0(Base64.java:714)
at java.util.Base64$Decoder.decode(Base64.java:526)
at com.clevertap.apns.internal.JWT.ES256(JWT.java:82)
at com.clevertap.apns.internal.JWT.getToken(JWT.java:64)
at com.clevertap.apns.clients.SyncOkHttpApnsClient.buildRequest(SyncOkHttpApnsClient.java:252)
at com.clevertap.apns.clients.SyncOkHttpApnsClient.push(SyncOkHttpApnsClient.java:267)
at com.kerwinyang.training.apns.core.APNsHttp2Test.testAPNsHttp2Sync(APNsHttp2Test.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
from apns-http2.
from apns-http2.
by the way, should I put in the ALPN JAR in my boot classpath when using provider authentication tokens
from apns-http2.
from apns-http2.
Closing due to inactivity.
from apns-http2.
Related Issues (20)
- How to set alert option "subtitle"? HOT 2
- What should be system configuration while using this api
- CertificateUtils should support the VoIP message
- some APS new Dictionary Keys are not supported
- com.clevertap.apns.exceptions.CertificateEnvironmentMismatchException: Invalid environment for this certificate
- unexpected end of stream on okhttp3.Address@2f8c2e51 HOT 2
- ALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?
- alpn-boot jar causing conflict with jdbc (Oracle) connection
- How to handle socket timeout exception
- failure: NotificationResponse{error=null, httpStatusCode=-1, responseBody='null', cause=java.io.IOException: unexpected end of stream on okhttp3.Address@e9db4294} HOT 3
- Java 11 java.io.IOException: unexpected end of stream on okhttp3.Address
- Confusing release policy: 1.0.3 vs 1.0.5 vs 1.0.7
- Is it possible to get apns topic from cert automatically
- PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target HOT 1
- Ability to omit "alert" in payload
- If jdk8 version > 8u252, does it still need to add Jetty's ALPN JAR dependency? HOT 3
- java.lang.IllegalArgumentException: Unexpected char 0x0d
- unexpected end of stream on Connection {api.sandbox.push.apple.com:443 HOT 3
- apns-http2: v2.0.0 is not pulling in the version of okHttp specified in pom.xml
- Support MDM payload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apns-http2.