Skip to content

Commit 6be21bf

Browse files
Resolves #66, add appAppleId + Production IllegalArgumentException
1 parent 7ad5561 commit 6be21bf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ public class ExampleVerification {
8989
new FileInputStream("/path/to/rootCA1"),
9090
new FileInputStream("/path/to/rootCA2")
9191
);
92+
Long appAppleId = null; // appAppleId must be provided for the Production environment
9293

93-
SignedDataVerifier signedPayloadVerifier = new SignedDataVerifier(rootCAs, bundleId, null, environment, true);
94+
SignedDataVerifier signedPayloadVerifier = new SignedDataVerifier(rootCAs, bundleId, appAppleId, environment, true);
9495

9596
String notificationPayload = "ey...";
9697

src/main/java/com/apple/itunes/storekit/verification/SignedDataVerifier.java

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public SignedDataVerifier(Set<InputStream> rootCertificates, String bundleId, Lo
5555
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE)
5656
.withSetterVisibility(JsonAutoDetect.Visibility.NONE)
5757
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE));
58+
if (appAppleId == null && Environment.PRODUCTION.equals(environment)) {
59+
throw new IllegalArgumentException("appAppleId is required when the environment is Production");
60+
}
5861
}
5962

6063
/**

0 commit comments

Comments
 (0)