Using the awesome Java APNS by notnoop. https://github.com/notnoop/java-apns
For some reason when I want to pull in my keystore the entire object that houses the APNS just blows up. Here it is below:
object Notification {
val iosApnsDist =
APNS.newService()
.withCert("/ipush.dist.p12", "password")
.withSandboxDestination()
.build()
}
For those that are familiar with Play!, files added to the conf
folder are supposed to be available on the classpath. So I was a little confused as to why my reference would crash the app.
Below is a snippet from the APNS java source where the keystore is pulled in. Any thoughts?
public ApnsServiceBuilder withCert(String fileName, String password)
throws RuntimeIOException, InvalidSSLConfig {
FileInputStream stream = null;
try {
stream = new FileInputStream(fileName);
return withCert(stream, password);
} catch (FileNotFoundException e) {
throw new RuntimeIOException(e);
} finally {
Utilities.close(stream);
}
}
Update
I was able to extract an error message while running a try/catch during bootup. Basically, it can't find the file:
Caused by: com.notnoop.exceptions.RuntimeIOException: java.io.FileNotFoundException: \ipush.dev.p12 (The system cannot find the file specified)
at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:116)
at engine.logic.notification.Notification$.<init>(Notification.scala:61)
I can confirm the file is indeed in the /conf folder, so what's the cause?