Skip to content

Commit 7a02183

Browse files
Merge pull request #68 from alexanderjordanbaker/AppAppleIdProdException
Resolves https://github.com/apple/app-store-server-library-java/issue…
2 parents 526a998 + 6be21bf commit 7a02183

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)