← back to Nineoh Guide
Add read-only App Store approval-check script (for AdMob-link-after-approval task)
5d90004cebff0affcf77fe8875403d993996818d · 2026-08-06 07:54:07 -0700 · Steve Abrams
Files touched
A scripts/check-approval.mjs
Diff
commit 5d90004cebff0affcf77fe8875403d993996818d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 6 07:54:07 2026 -0700
Add read-only App Store approval-check script (for AdMob-link-after-approval task)
---
scripts/check-approval.mjs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/scripts/check-approval.mjs b/scripts/check-approval.mjs
new file mode 100644
index 0000000..60616cc
--- /dev/null
+++ b/scripts/check-approval.mjs
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+// Read-only: report the App Store review state of Unofficial 90210 Guide.
+// When it reaches READY_FOR_SALE / PENDING_DEVELOPER_RELEASE / APPROVED, it's
+// time to link the AdMob app (id 3798456380) to the App Store listing.
+// Usage: node scripts/check-approval.mjs (run from anywhere; keypath is absolute)
+import { readFileSync } from 'node:fs'; import { createSign } from 'node:crypto';
+const KEY = '/Users/macstudio3/Projects/tesla/apps/mobile/credentials/AuthKey_72Y2TZT54R.p8';
+const key = readFileSync(KEY, 'utf8');
+const b64u = (o) => Buffer.from(typeof o === 'string' ? o : JSON.stringify(o)).toString('base64url');
+const now = Math.floor(Date.now() / 1000);
+const jwt = `${b64u({ alg: 'ES256', kid: '72Y2TZT54R', typ: 'JWT' })}.${b64u({ iss: 'cfbd63ed-301b-465c-aad7-49e94420ad70', iat: now, exp: now + 600, aud: 'appstoreconnect-v1' })}`;
+const sg = createSign('SHA256'); sg.update(jwt); sg.end();
+const token = `${jwt}.${sg.sign({ key, dsaEncoding: 'ieee-p1363' }).toString('base64url')}`;
+const r = await fetch('https://api.appstoreconnect.apple.com/v1/apps/6798381949/appStoreVersions?fields[appStoreVersions]=appStoreState,versionString&limit=1', { headers: { Authorization: `Bearer ${token}` } });
+const j = await r.json();
+const v = j.data?.[0]?.attributes;
+const state = v?.appStoreState;
+const LIVE = ['READY_FOR_SALE', 'PENDING_DEVELOPER_RELEASE', 'PENDING_APPLE_RELEASE', 'APPROVED'];
+console.log(`Unofficial 90210 Guide v${v?.versionString} → ${state}`);
+if (LIVE.includes(state)) {
+ console.log('APPROVED ✅ — time to link the AdMob app (3798456380) to the App Store listing.');
+ process.exit(10);
+}
+process.exit(0);
← 182ad70 Wire real AdMob banner: iosAppId ca-app-pub-5278231299883833
·
back to Nineoh Guide
·
chore: lint (tsc clean), light refactor (import order, label 51de6ce →