@leonxin/meetgames 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/dist/android/detect.d.ts +6 -1
- package/dist/android/detect.d.ts.map +1 -1
- package/dist/android/detect.js +41 -17
- package/dist/android/detect.js.map +1 -1
- package/dist/android/gradle.d.ts.map +1 -1
- package/dist/android/gradle.js +8 -1
- package/dist/android/gradle.js.map +1 -1
- package/dist/android/meetSdkRemoteGradle.d.ts +1 -0
- package/dist/android/meetSdkRemoteGradle.d.ts.map +1 -1
- package/dist/android/meetSdkRemoteGradle.js +44 -21
- package/dist/android/meetSdkRemoteGradle.js.map +1 -1
- package/dist/cache.d.ts +16 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +21 -0
- package/dist/cache.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +52 -23
- package/dist/cli.js.map +1 -1
- package/dist/config/meetSdkDefaultConfig.d.ts +7 -11
- package/dist/config/meetSdkDefaultConfig.d.ts.map +1 -1
- package/dist/config/meetSdkDefaultConfig.js +216 -53
- package/dist/config/meetSdkDefaultConfig.js.map +1 -1
- package/dist/config/meetSdkIosConfig.d.ts +4 -5
- package/dist/config/meetSdkIosConfig.d.ts.map +1 -1
- package/dist/config/meetSdkIosConfig.js +19 -19
- package/dist/config/meetSdkIosConfig.js.map +1 -1
- package/dist/contracts/types.d.ts +18 -0
- package/dist/contracts/types.d.ts.map +1 -1
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +18 -1
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/platform.js +1 -1
- package/dist/core/platform.js.map +1 -1
- package/dist/core/previewPatches.d.ts +2 -2
- package/dist/core/previewPatches.d.ts.map +1 -1
- package/dist/core/previewPatches.js +3 -3
- package/dist/core/previewPatches.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +3 -1
- package/dist/core/workspace.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/service.d.ts +6 -0
- package/dist/mcp/service.d.ts.map +1 -1
- package/dist/mcp/service.js +17 -9
- package/dist/mcp/service.js.map +1 -1
- package/dist/ops/handlers.d.ts.map +1 -1
- package/dist/ops/handlers.js +25 -3
- package/dist/ops/handlers.js.map +1 -1
- package/dist/remote/sdkHomeDownload.d.ts +4 -5
- package/dist/remote/sdkHomeDownload.d.ts.map +1 -1
- package/dist/remote/sdkHomeDownload.js +38 -12
- package/dist/remote/sdkHomeDownload.js.map +1 -1
- package/docs/API.md +13 -13
- package/docs/CLI.md +27 -13
- package/docs/INTEGRATION.md +7 -6
- package/package.json +1 -1
- package/src/android/detect.ts +47 -17
- package/src/android/gradle.ts +16 -1
- package/src/android/meetSdkRemoteGradle.ts +50 -22
- package/src/cache.ts +37 -0
- package/src/cli.ts +51 -21
- package/src/config/meetSdkDefaultConfig.ts +243 -59
- package/src/config/meetSdkIosConfig.ts +17 -21
- package/src/contracts/types.ts +21 -0
- package/src/core/doctor.ts +17 -1
- package/src/core/platform.ts +1 -1
- package/src/core/previewPatches.ts +3 -3
- package/src/core/workspace.ts +3 -1
- package/src/index.ts +5 -3
- package/src/mcp/server.ts +12 -7
- package/src/mcp/service.ts +30 -10
- package/src/ops/handlers.ts +27 -3
- package/src/remote/sdkHomeDownload.ts +48 -16
- package/config/meetsdk-android.json +0 -171
- package/config/meetsdk-ios.json +0 -15
- package/tests/assemble.test.ts +0 -12
- package/tests/doctor.test.ts +0 -131
- package/tests/downloadGoogleServicesJson.test.ts +0 -47
- package/tests/fetch-remote.test.ts +0 -23
- package/tests/fetchConfigOverrides.test.ts +0 -28
- package/tests/fetchConfigWrite.test.ts +0 -54
- package/tests/fixtures-hosts.test.ts +0 -78
- package/tests/gradle.test.ts +0 -33
- package/tests/integration-json.test.ts +0 -29
- package/tests/ios.codeUtils.test.ts +0 -23
- package/tests/ios.sdkBundle.test.ts +0 -21
- package/tests/loadManifest.test.ts +0 -15
- package/tests/manifest-xml.test.ts +0 -30
- package/tests/mcp.e2e.ts +0 -214
- package/tests/mcp.service.test.ts +0 -53
- package/tests/meetSdkRemoteConfig.test.ts +0 -482
- package/tests/meetSdkRemoteGradle.test.ts +0 -414
- package/tests/pipeline.android.test.ts +0 -149
- package/tests/pipeline.integration-json.test.ts +0 -58
- package/tests/pipeline.ios.test.ts +0 -609
- package/tests/pipeline.preview.patch.test.ts +0 -85
- package/tests/platformSelection.test.ts +0 -77
- package/tests/sdkHomeDownload.test.ts +0 -275
- package/tests/sdkVersionConfig.test.ts +0 -131
- package/tests/topsdk.test.ts +0 -53
- package/tests/topsdkDownloadSdkConfig.test.ts +0 -81
- package/tests/topsdkFeatureModules.test.ts +0 -116
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { describe, expect, it } from "vitest";
|
|
6
|
-
import { loadManifestFile } from "../src/config/loadManifest.js";
|
|
7
|
-
import { buildWorkspaceContext } from "../src/core/workspace.js";
|
|
8
|
-
import { runPipeline } from "../src/core/pipeline.js";
|
|
9
|
-
import { detectIOS } from "../src/ios/detect.js";
|
|
10
|
-
import { parsePlistXml } from "../src/ios/infoPlist.js";
|
|
11
|
-
import { resolveIosSdkRootFromDirectory } from "../src/remote/sdkHomeDownload.js";
|
|
12
|
-
|
|
13
|
-
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const pkgRoot = path.resolve(here, "..");
|
|
15
|
-
const iosRoot = path.join(pkgRoot, "fixtures", "ios-test-project", "native-sample");
|
|
16
|
-
const hasIosProjectFixture = fs.existsSync(iosRoot);
|
|
17
|
-
const manifest = () => loadManifestFile(path.join(pkgRoot, "recipes", "ios-default.yaml"));
|
|
18
|
-
const fixtureIosSdkRoot = resolveIosSdkRootFromDirectory(path.join(pkgRoot, "fixtures", "ios-sdk", "topSDK-ios--V1.6.0.5"));
|
|
19
|
-
|
|
20
|
-
function copyProjectToTemp(): string {
|
|
21
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "meet-ios-native-sample-"));
|
|
22
|
-
fs.cpSync(iosRoot, tmp, { recursive: true });
|
|
23
|
-
writeNativeSampleRemoteConfig(tmp);
|
|
24
|
-
return tmp;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function writeNativeSampleRemoteConfig(projectRoot: string): void {
|
|
28
|
-
const remote = {
|
|
29
|
-
packageName: "com.meetgames.topsdk.demo",
|
|
30
|
-
channel: "APPLE",
|
|
31
|
-
devicePlatform: "ios",
|
|
32
|
-
topsdk: {
|
|
33
|
-
appId: "mock-ios-native-sample-app-id",
|
|
34
|
-
appSecret: "mock-ios-native-sample-app-secret-do-not-use-in-production",
|
|
35
|
-
},
|
|
36
|
-
sdkModules: {
|
|
37
|
-
login: {
|
|
38
|
-
guest: {},
|
|
39
|
-
facebook: {
|
|
40
|
-
clientId: "883695101201170",
|
|
41
|
-
scheme: "fb883695101201170",
|
|
42
|
-
secret: "f840b8663b1351ddcb8f6a640cee18c6",
|
|
43
|
-
name: "top-demo",
|
|
44
|
-
openMessenger: "0",
|
|
45
|
-
},
|
|
46
|
-
google: {
|
|
47
|
-
clientId: "396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql.apps.googleusercontent.com",
|
|
48
|
-
scheme: "com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql",
|
|
49
|
-
},
|
|
50
|
-
apple: {},
|
|
51
|
-
},
|
|
52
|
-
payment: {
|
|
53
|
-
appleIap: {},
|
|
54
|
-
},
|
|
55
|
-
analytics: {
|
|
56
|
-
appsflyer: {
|
|
57
|
-
devKey: "af-dev-key",
|
|
58
|
-
appleAppId: "123456789",
|
|
59
|
-
enableDebugLog: true,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
fs.writeFileSync(path.join(projectRoot, "meetsdk-remote-config.json"), JSON.stringify(remote, null, 2), "utf8");
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function pbxBuildFileRefErrors(pbx: string): string[] {
|
|
68
|
-
const fileRefs = new Set<string>();
|
|
69
|
-
for (const match of pbx.matchAll(/^\s*([A-F0-9]{24}) \/\* .* \*\/ = \{isa = PBXFileReference;/gm)) {
|
|
70
|
-
fileRefs.add(match[1]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const errors: string[] = [];
|
|
74
|
-
for (const match of pbx.matchAll(
|
|
75
|
-
/^\s*([A-F0-9]{24}) \/\* (.*?) \*\/ = \{isa = PBXBuildFile; fileRef = ([A-F0-9]{24}) /gm
|
|
76
|
-
)) {
|
|
77
|
-
const [, buildFileId, label, fileRefId] = match;
|
|
78
|
-
if (!fileRefs.has(fileRefId)) errors.push(`${label}: ${buildFileId} -> ${fileRefId}`);
|
|
79
|
-
}
|
|
80
|
-
return errors;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function plannedIosAsset(patch: string, binaryCopies: Array<{ relTo: string }>, name: string): boolean {
|
|
84
|
-
return patch.includes(name) || binaryCopies.some((c) => c.relTo.includes(name));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function occurrenceCount(content: string, needle: string): number {
|
|
88
|
-
return content.split(needle).length - 1;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function regexCount(content: string, pattern: RegExp): number {
|
|
92
|
-
return [...content.matchAll(pattern)].length;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function testIosContext(projectRoot: string) {
|
|
96
|
-
return buildWorkspaceContext(projectRoot, pkgRoot, { iosSdkRoot: fixtureIosSdkRoot });
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
describe("pipeline ios fixture SDK", () => {
|
|
100
|
-
it("resolves TopSDK iOS fixture package", () => {
|
|
101
|
-
expect(fs.existsSync(path.join(fixtureIosSdkRoot, "sdk", "topsdkConfig.t.json"))).toBe(true);
|
|
102
|
-
expect(fs.existsSync(path.join(fixtureIosSdkRoot, "plugins", "GuestSignin", "config.t.json"))).toBe(true);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
107
|
-
it("detects native-sample xcodeproj with AppDelegate target", () => {
|
|
108
|
-
const d = detectIOS(iosRoot);
|
|
109
|
-
expect(d.ok).toBe(true);
|
|
110
|
-
if (d.ok) {
|
|
111
|
-
expect(d.targetName).toBe("native-sample");
|
|
112
|
-
expect(fs.existsSync(path.join(iosRoot, "native-sample", "AppDelegate.m"))).toBe(true);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("detects when project root is the xcodeproj directory itself", () => {
|
|
117
|
-
const xcodeprojRoot = path.join(iosRoot, "native-sample.xcodeproj");
|
|
118
|
-
const d = detectIOS(xcodeprojRoot);
|
|
119
|
-
expect(d.ok).toBe(true);
|
|
120
|
-
if (d.ok) {
|
|
121
|
-
expect(d.xcodeprojPath).toBe(xcodeprojRoot);
|
|
122
|
-
expect(d.targetName).toBe("native-sample");
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("builds workspace context when project root is the xcodeproj directory", () => {
|
|
127
|
-
const ctx = testIosContext(path.join(iosRoot, "native-sample.xcodeproj"));
|
|
128
|
-
expect(ctx.ios?.ok).toBe(true);
|
|
129
|
-
expect(ctx.ios?.ok && ctx.ios.xcodeprojPath).toBe(path.join(iosRoot, "native-sample.xcodeproj"));
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it("dry-run: plans TOPCore + GuestSignin frameworks and pbxproj edits", async () => {
|
|
133
|
-
const tmp = copyProjectToTemp();
|
|
134
|
-
try {
|
|
135
|
-
const ctx = testIosContext(tmp);
|
|
136
|
-
expect(ctx.ios?.ok).toBe(true);
|
|
137
|
-
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
138
|
-
expect(report.errors).toEqual([]);
|
|
139
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPCore.framework")).toBe(true);
|
|
140
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPGuestSigninPlugin.framework")).toBe(true);
|
|
141
|
-
expect(binaryCopies.some((c) => c.relTo.includes("topSDK/TOPCore.framework"))).toBe(true);
|
|
142
|
-
expect(binaryCopies.some((c) => c.relTo.includes("topSDK/TOPGuestSigninPlugin.framework"))).toBe(true);
|
|
143
|
-
|
|
144
|
-
} finally {
|
|
145
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it("apply: copies SDK, updates pbxproj, injects AppDelegate", async () => {
|
|
150
|
-
const tmp = copyProjectToTemp();
|
|
151
|
-
try {
|
|
152
|
-
const ctx = testIosContext(tmp);
|
|
153
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
154
|
-
expect(report.errors).toEqual([]);
|
|
155
|
-
|
|
156
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPCore.framework"))).toBe(true);
|
|
157
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPSDK.framework"))).toBe(true);
|
|
158
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPGuestSigninPlugin.framework"))).toBe(true);
|
|
159
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPIAPPayPlugin.framework"))).toBe(true);
|
|
160
|
-
expect(fs.readFileSync(path.join(tmp, "topSDK", "TopSDKInstall.swift"), "utf8")).toBe("");
|
|
161
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TopSDKSource.bundle"))).toBe(true);
|
|
162
|
-
expect(
|
|
163
|
-
fs.readlinkSync(
|
|
164
|
-
path.join(
|
|
165
|
-
tmp,
|
|
166
|
-
"topSDK",
|
|
167
|
-
"FBSDKLoginKit.xcframework",
|
|
168
|
-
"ios-arm64_x86_64-maccatalyst",
|
|
169
|
-
"FBSDKLoginKit.framework",
|
|
170
|
-
"FBSDKLoginKit"
|
|
171
|
-
)
|
|
172
|
-
)
|
|
173
|
-
).toBe("Versions/Current/FBSDKLoginKit");
|
|
174
|
-
|
|
175
|
-
const pbx = fs.readFileSync(path.join(tmp, "native-sample.xcodeproj", "project.pbxproj"), "utf8");
|
|
176
|
-
expect(pbx).toContain("TOPCore.framework");
|
|
177
|
-
expect(pbx).toContain("TOPGuestSigninPlugin.framework");
|
|
178
|
-
expect(pbx).toContain("TOPIAPPayPlugin.framework in Frameworks");
|
|
179
|
-
expect(pbx).toContain("TOPCoreModel.xcdatamodeld in Sources");
|
|
180
|
-
expect(pbx).not.toContain("TOPCoreModel.xcdatamodeld in Resources");
|
|
181
|
-
expect(pbx).not.toContain("FBSDKLoginKit.xcframework in Resources");
|
|
182
|
-
expect(pbx).toContain(
|
|
183
|
-
'FBSDKLoginKit.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:V9WTTPBFK9:Meta Platforms, Inc."; lastKnownFileType = wrapper.xcframework; name = FBSDKLoginKit.xcframework; path = topSDK/FBSDKLoginKit.xcframework; sourceTree = SOURCE_ROOT; };'
|
|
184
|
-
);
|
|
185
|
-
expect(pbx).toContain("FBSDKCoreKit.xcframework");
|
|
186
|
-
expect(pbx).toContain("FBSDKCoreKit_Basics.xcframework");
|
|
187
|
-
expect(pbx).toContain("FBAEMKit.xcframework");
|
|
188
|
-
expect(pbx).not.toContain('path = "topSDK/FBSDKLoginKit.xcframework"; sourceTree = "<group>";');
|
|
189
|
-
expect(pbx).toContain("LIBRARY_SEARCH_PATHS = \"$(SRCROOT)/topSDK\"");
|
|
190
|
-
expect(pbx).toContain("SWIFT_VERSION = 5.0");
|
|
191
|
-
expect(pbx).toContain('"-ObjC"');
|
|
192
|
-
expect(pbx).toContain("libc++.tbd");
|
|
193
|
-
expect(pbx).not.toMatch(/\n\s+-ObjC,/);
|
|
194
|
-
expect(pbxBuildFileRefErrors(pbx).filter((e) => /TOP|FBSDK|Google|AppsFlyer|TopSDKInstall/.test(e))).toEqual([]);
|
|
195
|
-
expect(pbx).not.toMatch(/\bundefined;/);
|
|
196
|
-
|
|
197
|
-
const delegate = fs.readFileSync(path.join(tmp, "native-sample", "AppDelegate.m"), "utf8");
|
|
198
|
-
expect(delegate).toContain("#import <TOPSDK/TopSDK.h>");
|
|
199
|
-
expect(delegate).toContain("TopSDK.sharedInstance");
|
|
200
|
-
expect(delegate).toContain("TOPDataSDK");
|
|
201
|
-
|
|
202
|
-
const plist = fs.readFileSync(path.join(tmp, "native-sample", "Info.plist"), "utf8");
|
|
203
|
-
expect(plist).toContain("<key>TOPSDK</key>");
|
|
204
|
-
expect(plist).toContain("<key>APP_ID</key>");
|
|
205
|
-
expect(plist).toContain("mock-ios-native-sample-app-id");
|
|
206
|
-
expect(plist).toContain("GuestSignin");
|
|
207
|
-
expect(plist).toContain("IAPPay");
|
|
208
|
-
expect(plist).not.toContain("NSAppTransportSecurity");
|
|
209
|
-
} finally {
|
|
210
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it("apply: is idempotent and logs iOS value updates", async () => {
|
|
215
|
-
const tmp = copyProjectToTemp();
|
|
216
|
-
try {
|
|
217
|
-
const plistPath = path.join(tmp, "native-sample", "Info.plist");
|
|
218
|
-
const beforePlist = fs.readFileSync(plistPath, "utf8");
|
|
219
|
-
fs.writeFileSync(
|
|
220
|
-
plistPath,
|
|
221
|
-
beforePlist
|
|
222
|
-
.replace("<key>FacebookAppID</key>\n\t<string>883695101201170</string>", "<key>FacebookAppID</key>\n\t<string>old-facebook-app-id</string>")
|
|
223
|
-
.replace(
|
|
224
|
-
"</dict>\n</plist>",
|
|
225
|
-
"\t<key>LSApplicationQueriesSchemes</key>\n\t<array>\n\t\t<string>fbapi</string>\n\t</array>\n\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n\t\t\t\t<string>fb883695101201170</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>"
|
|
226
|
-
),
|
|
227
|
-
"utf8"
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
const first = await runPipeline(testIosContext(tmp), manifest(), { dryRun: false });
|
|
231
|
-
expect(first.report.errors).toEqual([]);
|
|
232
|
-
const firstLogs = (first.report.logs ?? []).join("\n");
|
|
233
|
-
expect(firstLogs).toContain("SUCCESS: info.plist配置key:FacebookAppID old-facebook-app-id -> 883695101201170");
|
|
234
|
-
|
|
235
|
-
const second = await runPipeline(testIosContext(tmp), manifest(), { dryRun: false });
|
|
236
|
-
expect(second.report.errors).toEqual([]);
|
|
237
|
-
const secondLogs = (second.report.logs ?? []).join("\n");
|
|
238
|
-
expect(secondLogs).toContain("SUCCESS: info.plist配置key:FacebookAppID 未变化 value:883695101201170");
|
|
239
|
-
expect(secondLogs).toContain("SUCCESS: BuildSetting设置VALIDATE_WORKSPACE 未变化 value:YES");
|
|
240
|
-
|
|
241
|
-
const plist = fs.readFileSync(plistPath, "utf8");
|
|
242
|
-
const plistData = parsePlistXml(plist);
|
|
243
|
-
const queries = Array.isArray(plistData.LSApplicationQueriesSchemes)
|
|
244
|
-
? (plistData.LSApplicationQueriesSchemes as string[])
|
|
245
|
-
: [];
|
|
246
|
-
const urlTypes = Array.isArray(plistData.CFBundleURLTypes)
|
|
247
|
-
? (plistData.CFBundleURLTypes as Array<Record<string, unknown>>)
|
|
248
|
-
: [];
|
|
249
|
-
const urlSchemes = urlTypes.flatMap((entry) =>
|
|
250
|
-
Array.isArray(entry.CFBundleURLSchemes) ? (entry.CFBundleURLSchemes as string[]) : []
|
|
251
|
-
);
|
|
252
|
-
expect(occurrenceCount(plist, "<key>FacebookAppID</key>")).toBe(1);
|
|
253
|
-
expect(occurrenceCount(plist, "<key>FacebookClientToken</key>")).toBe(1);
|
|
254
|
-
expect(queries.filter((scheme) => scheme === "fbapi")).toHaveLength(1);
|
|
255
|
-
expect(urlSchemes.filter((scheme) => scheme === "fb883695101201170")).toHaveLength(1);
|
|
256
|
-
expect(urlSchemes.filter((scheme) => scheme === "com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql")).toHaveLength(1);
|
|
257
|
-
expect(occurrenceCount(plist, "<key>TOPSDK</key>")).toBe(1);
|
|
258
|
-
|
|
259
|
-
const pbx = fs.readFileSync(path.join(tmp, "native-sample.xcodeproj", "project.pbxproj"), "utf8");
|
|
260
|
-
expect(regexCount(pbx, /\/\* TopSDKInstall\.swift in Sources \*\/ = \{isa = PBXBuildFile;/g)).toBe(1);
|
|
261
|
-
expect(regexCount(pbx, /\/\* TOPFacebookSigninPlugin\.framework in Frameworks \*\/ = \{isa = PBXBuildFile;/g)).toBe(1);
|
|
262
|
-
expect(regexCount(pbx, /\/\* TOPGoogleSigninPlugin\.framework in Frameworks \*\/ = \{isa = PBXBuildFile;/g)).toBe(1);
|
|
263
|
-
expect(occurrenceCount(pbx, "VALIDATE_WORKSPACE = YES")).toBe(2);
|
|
264
|
-
} finally {
|
|
265
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
it("apply: enables Apple Sign In entitlement when AppleSignin plugin is enabled", async () => {
|
|
270
|
-
const tmp = copyProjectToTemp();
|
|
271
|
-
try {
|
|
272
|
-
const configPath = path.join(tmp, "meetsdk-remote-config.json");
|
|
273
|
-
const remote = JSON.parse(fs.readFileSync(configPath, "utf8")) as Record<string, unknown>;
|
|
274
|
-
remote.sdkModules = {
|
|
275
|
-
login: { apple: {} },
|
|
276
|
-
payment: {},
|
|
277
|
-
analytics: {},
|
|
278
|
-
};
|
|
279
|
-
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
280
|
-
|
|
281
|
-
const ctx = testIosContext(tmp);
|
|
282
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
283
|
-
expect(report.errors).toEqual([]);
|
|
284
|
-
|
|
285
|
-
const entitlementsPath = path.join(tmp, "native-sample", "native-sample.entitlements");
|
|
286
|
-
expect(fs.existsSync(entitlementsPath)).toBe(true);
|
|
287
|
-
const entitlements = fs.readFileSync(entitlementsPath, "utf8");
|
|
288
|
-
expect(entitlements).toContain("com.apple.developer.applesignin");
|
|
289
|
-
expect(entitlements).toContain("Default");
|
|
290
|
-
|
|
291
|
-
const pbx = fs.readFileSync(path.join(tmp, "native-sample.xcodeproj", "project.pbxproj"), "utf8");
|
|
292
|
-
expect(pbx).toContain("CODE_SIGN_ENTITLEMENTS");
|
|
293
|
-
expect(pbx).toContain("native-sample/native-sample.entitlements");
|
|
294
|
-
expect(pbx).toContain("TOPAppleSigninPlugin.framework");
|
|
295
|
-
} finally {
|
|
296
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
it("dry-run: maps supported iOS plugin params from meetsdk remote config", async () => {
|
|
301
|
-
const tmp = copyProjectToTemp();
|
|
302
|
-
try {
|
|
303
|
-
const configPath = path.join(tmp, "meetsdk-remote-config.json");
|
|
304
|
-
const remote = JSON.parse(fs.readFileSync(configPath, "utf8")) as Record<string, unknown>;
|
|
305
|
-
remote.sdkModules = {
|
|
306
|
-
login: {
|
|
307
|
-
guest: {},
|
|
308
|
-
email: {},
|
|
309
|
-
apple: {},
|
|
310
|
-
facebook: {
|
|
311
|
-
clientId: "fb-app",
|
|
312
|
-
scheme: "fb-scheme",
|
|
313
|
-
secret: "fb-token",
|
|
314
|
-
name: "Facebook Display",
|
|
315
|
-
},
|
|
316
|
-
google: {
|
|
317
|
-
clientId: "google-client",
|
|
318
|
-
scheme: "google-reversed",
|
|
319
|
-
},
|
|
320
|
-
snapchat: {
|
|
321
|
-
clientId: "snap-client",
|
|
322
|
-
redirect: "snap-redirect",
|
|
323
|
-
scheme: "snap-scheme",
|
|
324
|
-
},
|
|
325
|
-
line: {
|
|
326
|
-
clientId: "line-client",
|
|
327
|
-
scheme: "line-scheme",
|
|
328
|
-
},
|
|
329
|
-
naver: {
|
|
330
|
-
clientId: "naver-client",
|
|
331
|
-
secret: "naver-secret",
|
|
332
|
-
name: "Naver Name",
|
|
333
|
-
scheme: "naver-scheme",
|
|
334
|
-
},
|
|
335
|
-
kakao: {
|
|
336
|
-
clientId: "kakao-client",
|
|
337
|
-
scheme: "kakao-scheme",
|
|
338
|
-
},
|
|
339
|
-
tiktok: {
|
|
340
|
-
clientId: "tiktok-client",
|
|
341
|
-
secret: "tiktok-secret",
|
|
342
|
-
redirect: "tiktok-scheme://callback",
|
|
343
|
-
},
|
|
344
|
-
discord: {
|
|
345
|
-
clientId: "discord-client",
|
|
346
|
-
secret: "discord-secret",
|
|
347
|
-
redirect: "https://example.invalid/oauth-redirect.html",
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
payment: {
|
|
351
|
-
googleIap: {},
|
|
352
|
-
},
|
|
353
|
-
analytics: {
|
|
354
|
-
appsflyer: {
|
|
355
|
-
devKey: "af-dev-key",
|
|
356
|
-
appleAppId: "123456789",
|
|
357
|
-
enableDebugLog: true,
|
|
358
|
-
},
|
|
359
|
-
adjust: {
|
|
360
|
-
appCode: "adjust-token",
|
|
361
|
-
enableSandbox: true,
|
|
362
|
-
},
|
|
363
|
-
facebookdata: {
|
|
364
|
-
clientId: "fb-app",
|
|
365
|
-
scheme: "fb-scheme",
|
|
366
|
-
secret: "fb-token",
|
|
367
|
-
name: "Facebook Display",
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
};
|
|
371
|
-
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
372
|
-
|
|
373
|
-
const ctx = testIosContext(tmp);
|
|
374
|
-
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
375
|
-
expect(report.errors).toEqual([]);
|
|
376
|
-
expect(report.warnings.join("\n")).not.toContain("Discord");
|
|
377
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPGoogleSigninPlugin.framework")).toBe(true);
|
|
378
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPFacebookSigninPlugin.framework")).toBe(true);
|
|
379
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPSnapchatSigninPlugin.framework")).toBe(true);
|
|
380
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPLineSigninPlugin.framework")).toBe(true);
|
|
381
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPNaverSigninPlugin.framework")).toBe(true);
|
|
382
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPKakaoSigninPlugin.framework")).toBe(true);
|
|
383
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPTiktokSigninPlugin.framework")).toBe(true);
|
|
384
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPDiscordSigninPlugin.framework")).toBe(true);
|
|
385
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPIAPPayPlugin.framework")).toBe(true);
|
|
386
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPDataAppsFlyerPlugin.framework")).toBe(true);
|
|
387
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPDataAdjustPlugin.framework")).toBe(true);
|
|
388
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPDataFacebookPlugin.framework")).toBe(true);
|
|
389
|
-
expect(patch).toContain("FacebookDisplayName");
|
|
390
|
-
expect(patch).toContain("Facebook Display");
|
|
391
|
-
expect(patch).toContain("REVERSED_CLIENT_ID");
|
|
392
|
-
expect(patch).toContain("google-reversed");
|
|
393
|
-
expect(patch).toContain("APPLE_APP_ID");
|
|
394
|
-
expect(patch).toContain("123456789");
|
|
395
|
-
expect(patch).toContain("APP_TOKEN");
|
|
396
|
-
expect(patch).toContain("adjust-token");
|
|
397
|
-
expect(patch).toContain("SCSDKRedirectUrl");
|
|
398
|
-
expect(patch).toContain("snap-redirect");
|
|
399
|
-
expect(binaryCopies.some((c) => c.relTo.includes("topSDK/TOPDataFacebookPlugin.framework"))).toBe(true);
|
|
400
|
-
} finally {
|
|
401
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it("dry-run: uses remote GoogleService-Info.plist for iOS Firebase instead of bundled source", async () => {
|
|
406
|
-
const tmp = copyProjectToTemp();
|
|
407
|
-
try {
|
|
408
|
-
const configPath = path.join(tmp, "meetsdk-remote-config.json");
|
|
409
|
-
const remote = JSON.parse(fs.readFileSync(configPath, "utf8")) as Record<string, unknown>;
|
|
410
|
-
remote.sdkModules = {
|
|
411
|
-
login: {},
|
|
412
|
-
payment: {},
|
|
413
|
-
analytics: {
|
|
414
|
-
firebase: {
|
|
415
|
-
firebaseUrl: "https://cdn.example.invalid/GoogleService-Info.plist",
|
|
416
|
-
firebaseName: "GoogleService-Info.plist",
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
};
|
|
420
|
-
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
421
|
-
|
|
422
|
-
const ctx = testIosContext(tmp);
|
|
423
|
-
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
424
|
-
|
|
425
|
-
expect(report.errors).toEqual([]);
|
|
426
|
-
expect(report.warnings.join("\n")).not.toContain("GoogleService-Info.plist");
|
|
427
|
-
expect((report.logs ?? []).join("\n")).toContain("would download GoogleService-Info.plist to native-sample/GoogleService-Info.plist");
|
|
428
|
-
expect(plannedIosAsset(patch, binaryCopies, "TOPDataFirebasePlugin.framework")).toBe(true);
|
|
429
|
-
} finally {
|
|
430
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
it("apply: keeps launch initialization in AppDelegate and routes URL/lifecycle callbacks to SceneDelegate when present", async () => {
|
|
435
|
-
const tmp = copyProjectToTemp();
|
|
436
|
-
try {
|
|
437
|
-
fs.writeFileSync(
|
|
438
|
-
path.join(tmp, "native-sample", "AppDelegate.m"),
|
|
439
|
-
`#import "AppDelegate.h"
|
|
440
|
-
|
|
441
|
-
@implementation AppDelegate
|
|
442
|
-
|
|
443
|
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
444
|
-
return YES;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
@end
|
|
448
|
-
`,
|
|
449
|
-
"utf8"
|
|
450
|
-
);
|
|
451
|
-
fs.writeFileSync(
|
|
452
|
-
path.join(tmp, "native-sample", "SceneDelegate.m"),
|
|
453
|
-
`#import "SceneDelegate.h"
|
|
454
|
-
|
|
455
|
-
@implementation SceneDelegate
|
|
456
|
-
|
|
457
|
-
@end
|
|
458
|
-
`,
|
|
459
|
-
"utf8"
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
const ctx = testIosContext(tmp);
|
|
463
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
464
|
-
expect(report.errors).toEqual([]);
|
|
465
|
-
|
|
466
|
-
const appDelegate = fs.readFileSync(path.join(tmp, "native-sample", "AppDelegate.m"), "utf8");
|
|
467
|
-
expect(appDelegate).toContain("[TopSDK.sharedInstance application:application didFinishLaunchingWithOptions:launchOptions]");
|
|
468
|
-
expect(appDelegate).toContain("[TOPDataSDK application:application didFinishLaunchingWithOptions:launchOptions]");
|
|
469
|
-
expect(appDelegate).not.toContain("openURL:url options");
|
|
470
|
-
expect(appDelegate).not.toContain("continueUserActivity:userActivity restorationHandler");
|
|
471
|
-
expect(appDelegate).not.toContain("applicationDidEnterBackground");
|
|
472
|
-
expect(appDelegate).not.toContain("applicationWillEnterForeground");
|
|
473
|
-
|
|
474
|
-
const sceneDelegate = fs.readFileSync(path.join(tmp, "native-sample", "SceneDelegate.m"), "utf8");
|
|
475
|
-
expect(sceneDelegate).toContain("[TopSDK.sharedInstance scene:scene openURLContexts:URLContexts]");
|
|
476
|
-
expect(sceneDelegate).toContain("[TopSDK.sharedInstance scene:scene continueUserActivity:userActivity]");
|
|
477
|
-
expect(sceneDelegate).toContain("[TopSDK.sharedInstance sceneWillEnterForeground:scene]");
|
|
478
|
-
expect(sceneDelegate).toContain("[TopSDK.sharedInstance sceneDidEnterBackground:scene]");
|
|
479
|
-
} finally {
|
|
480
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
it("fails when the configured Info.plist file is missing", async () => {
|
|
485
|
-
const tmp = copyProjectToTemp();
|
|
486
|
-
try {
|
|
487
|
-
fs.rmSync(path.join(tmp, "native-sample", "Info.plist"));
|
|
488
|
-
|
|
489
|
-
const ctx = testIosContext(tmp);
|
|
490
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
491
|
-
|
|
492
|
-
expect(report.errors.join("\n")).toContain("Info.plist not found for iOS target native-sample");
|
|
493
|
-
} finally {
|
|
494
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
it("fails clearly when enabled iOS plugin is missing required remote params", async () => {
|
|
499
|
-
const tmp = copyProjectToTemp();
|
|
500
|
-
try {
|
|
501
|
-
const configPath = path.join(tmp, "meetsdk-remote-config.json");
|
|
502
|
-
const remote = JSON.parse(fs.readFileSync(configPath, "utf8")) as Record<string, unknown>;
|
|
503
|
-
remote.sdkModules = {
|
|
504
|
-
login: { google: {} },
|
|
505
|
-
payment: {},
|
|
506
|
-
analytics: {},
|
|
507
|
-
};
|
|
508
|
-
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
509
|
-
|
|
510
|
-
const ctx = testIosContext(tmp);
|
|
511
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
512
|
-
expect(report.errors.join("\n")).toContain("iOS remote config missing required channel params");
|
|
513
|
-
expect(report.errors.join("\n")).toContain("GoogleSignin: GOOGLE.scheme");
|
|
514
|
-
expect(report.errors.join("\n")).toContain("GoogleSignin: GOOGLE.clientId");
|
|
515
|
-
expect(report.results[0]?.changedFiles).toEqual([]);
|
|
516
|
-
} finally {
|
|
517
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
describe.skipIf(!hasIosProjectFixture)("pipeline ios native-sample parity", () => {
|
|
523
|
-
it("apply: mirrors topsdk-tool-ios logs and integration points for native-sample", async () => {
|
|
524
|
-
const tmp = copyProjectToTemp();
|
|
525
|
-
try {
|
|
526
|
-
const ctx = testIosContext(tmp);
|
|
527
|
-
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
528
|
-
expect(report.errors).toEqual([]);
|
|
529
|
-
|
|
530
|
-
const logs = (report.logs ?? []).join("\n");
|
|
531
|
-
expect(logs).toContain(`*** 项目根目录:${tmp} ***`);
|
|
532
|
-
expect(logs).toContain("- 插件:GuestSignin, 类型:1,版本:1.6.0.3");
|
|
533
|
-
expect(logs).toContain("SUCCESS: 插件UI接入完成");
|
|
534
|
-
expect(logs).toContain("SUCCESS: 导入三方依赖framework TOPFacebookSigninPlugin.framework 完成");
|
|
535
|
-
expect(logs).toContain("SUCCESS: BuildSetting设置VALIDATE_WORKSPACE为YES 完成");
|
|
536
|
-
expect(logs).toContain("SUCCESS: 未检测到Swift代码文件,自动添加TopSDKInstall.swift完成");
|
|
537
|
-
expect(logs).toContain("SUCCESS: 启用SigninWithApple完成");
|
|
538
|
-
expect(logs).toContain("检测到工程UIApplicationDelegate实现类,将自动接入对应接口");
|
|
539
|
-
expect(logs).toContain("已存在代码#import <TOPSDK/TopSDK.h>");
|
|
540
|
-
expect(logs).toContain("检测到工程存在UIWindowSceneDelegate实现类,将自动接入对应接口");
|
|
541
|
-
expect(logs).toContain("SUCCESS: info.plist配置写入完成");
|
|
542
|
-
expect(logs).toContain("!! 接入流程已全部结束 !!");
|
|
543
|
-
const orderedLogMarkers = [
|
|
544
|
-
"- 插件:GuestSignin, 类型:1,版本:1.6.0.3",
|
|
545
|
-
"SUCCESS: 插件GuestSignin接入完成",
|
|
546
|
-
"- 插件:UI, 类型:3,版本:1.6.0.3",
|
|
547
|
-
"SUCCESS: 插件UI接入完成",
|
|
548
|
-
"- 插件:IAPPay, 类型:2,版本:1.6.0.3",
|
|
549
|
-
"SUCCESS: 插件IAPPay接入完成",
|
|
550
|
-
"- 插件:AppsFlyerManager, 类型:4,版本:1.6.0.3",
|
|
551
|
-
"SUCCESS: info.plist添加配置key:NSAdvertisingAttributionReportEndpoint value:https://appsflyer-skadnetwork.com/ 完成",
|
|
552
|
-
"SUCCESS: 插件AppsFlyerManager接入完成",
|
|
553
|
-
"- 插件:FacebookSignin, 类型:1,版本:1.6.0.3",
|
|
554
|
-
"SUCCESS: 未检测到Swift代码文件,自动添加TopSDKInstall.swift完成",
|
|
555
|
-
"SUCCESS: 添加queriesSchemes:fbapi 完成",
|
|
556
|
-
"SUCCESS: 设置urlScheme:fb883695101201170完成",
|
|
557
|
-
"SUCCESS: 插件FacebookSignin接入完成",
|
|
558
|
-
"- 插件:GoogleSignin, 类型:1,版本:1.6.0.3",
|
|
559
|
-
"SUCCESS: 插件GoogleSignin接入完成",
|
|
560
|
-
"- 插件:AppleSignin, 类型:1,版本:1.6.0.3",
|
|
561
|
-
"SUCCESS: 启用SigninWithApple完成",
|
|
562
|
-
"SUCCESS: 插件AppleSignin接入完成",
|
|
563
|
-
"- 插件:TOPSDK, 类型:0,版本:1.6.0.3",
|
|
564
|
-
"检测到工程UIApplicationDelegate实现类,将自动接入对应接口",
|
|
565
|
-
"检测到工程存在UIWindowSceneDelegate实现类,将自动接入对应接口",
|
|
566
|
-
"SUCCESS: 插件TOPSDK接入完成",
|
|
567
|
-
"SUCCESS: info.plist配置写入完成",
|
|
568
|
-
];
|
|
569
|
-
let lastLogIndex = -1;
|
|
570
|
-
for (const marker of orderedLogMarkers) {
|
|
571
|
-
const index = logs.indexOf(marker);
|
|
572
|
-
expect(index, marker).toBeGreaterThan(lastLogIndex);
|
|
573
|
-
lastLogIndex = index;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPUIPlugin.framework"))).toBe(true);
|
|
577
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPFacebookSigninPlugin.framework"))).toBe(true);
|
|
578
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPGoogleSigninPlugin.framework"))).toBe(true);
|
|
579
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPAppleSigninPlugin.framework"))).toBe(true);
|
|
580
|
-
expect(fs.existsSync(path.join(tmp, "topSDK", "TopSDKSource.bundle"))).toBe(true);
|
|
581
|
-
expect(fs.readFileSync(path.join(tmp, "topSDK", "TopSDKInstall.swift"), "utf8")).toBe("");
|
|
582
|
-
|
|
583
|
-
const pbx = fs.readFileSync(path.join(tmp, "native-sample.xcodeproj", "project.pbxproj"), "utf8");
|
|
584
|
-
expect(pbx).toContain("TOPUIPlugin.framework");
|
|
585
|
-
expect(pbx).toContain("TOPFacebookSigninPlugin.framework");
|
|
586
|
-
expect(pbx).toContain("TopSDKInstall.swift");
|
|
587
|
-
expect(pbx).toContain("VALIDATE_WORKSPACE = YES");
|
|
588
|
-
expect(pbx).toContain("ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES");
|
|
589
|
-
expect(pbx).toContain("CODE_SIGN_ENTITLEMENTS");
|
|
590
|
-
expect(pbxBuildFileRefErrors(pbx).filter((e) => /TOP|FBSDK|Google|AppsFlyer|TopSDKInstall/.test(e))).toEqual([]);
|
|
591
|
-
|
|
592
|
-
const plist = fs.readFileSync(path.join(tmp, "native-sample", "Info.plist"), "utf8");
|
|
593
|
-
expect(plist).toContain("<key>FacebookAppID</key>");
|
|
594
|
-
expect(plist).toContain("883695101201170");
|
|
595
|
-
expect(plist).toContain("<key>FacebookDisplayName</key>");
|
|
596
|
-
expect(plist).toContain("top-demo");
|
|
597
|
-
expect(plist).toContain("<key>FacebookClientToken</key>");
|
|
598
|
-
expect(plist).toContain("fbapi20130214");
|
|
599
|
-
expect(plist).toContain("com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql");
|
|
600
|
-
expect(plist).toContain("<key>TOPSDK</key>");
|
|
601
|
-
|
|
602
|
-
const entitlements = fs.readFileSync(path.join(tmp, "native-sample", "native-sample.entitlements"), "utf8");
|
|
603
|
-
expect(entitlements).toContain("com.apple.developer.applesignin");
|
|
604
|
-
expect(entitlements).toContain("Default");
|
|
605
|
-
} finally {
|
|
606
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
});
|