You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -104,17 +104,30 @@ import(
104
104
"github.com/awa/go-iap/appstore/api"
105
105
)
106
106
107
+
// For generate key file and download it, please refer to https://developer.apple.com/documentation/appstoreserverapi/creating_api_keys_to_use_with_the_app_store_server_api
108
+
constACCOUNTPRIVATEKEY = `
109
+
-----BEGIN PRIVATE KEY-----
110
+
FAKEACCOUNTKEYBASE64FORMAT
111
+
-----END PRIVATE KEY-----
112
+
`
107
113
funcmain() {
108
-
// For generate key file and download it, please refer to https://developer.apple.com/documentation/appstoreserverapi/creating_api_keys_to_use_with_the_app_store_server_api
109
-
token:= &api.Token{
110
-
KeyContent : "key content", // Loads a .p8 certificate
111
-
KeyID : "2X9R4HXF34", // Your private key ID from App Store Connect (Ex: 2X9R4HXF34)
112
-
BundleID : "com.example.testbundleid2021", // Your app’s bundle ID
113
-
Issuer : "57246542-96fe-1a63-e053-0824d011072a", // Your issuer ID from the Keys page in App Store Connect (Ex: "57246542-96fe-1a63-e053-0824d011072a")
114
-
Sandbox : true, // default is Production
114
+
c:= &api.StoreConfig{
115
+
KeyContent: []byte(ACCOUNTPRIVATEKEY), // Loads a .p8 certificate
116
+
KeyID: "FAKEKEYID", // Your private key ID from App Store Connect (Ex: 2X9R4HXF34)
117
+
BundleID: "fake.bundle.id", // Your app’s bundle ID
118
+
Issuer: "xxxxx-xx-xx-xx-xxxxxxxxxx",// Your issuer ID from the Keys page in App Store Connect (Ex: "57246542-96fe-1a63-e053-0824d011072a")
0 commit comments