Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions plugin/src/withTiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@
config = withInfoPlist(config, (config) => {
// eslint-disable-next-line dot-notation
config.modResults['TikTokClientKey'] = tiktokClientKey;
config.modResults.CFBundleURLTypes = [
{
CFBundleURLSchemes: [tiktokClientKey],
},
];
config.modResults.LSApplicationQueriesSchemes = [

// Merge TikTok URL scheme with existing schemes instead of overwriting
const existingURLTypes = config.modResults.CFBundleURLTypes || [];
const tiktokURLType = { CFBundleURLSchemes: [tiktokClientKey] };
const hasScheme = existingURLTypes.some(
(urlType) =>
urlType.CFBundleURLSchemes &&
urlType.CFBundleURLSchemes.includes(tiktokClientKey)
);
if (!hasScheme) {
config.modResults.CFBundleURLTypes = [...existingURLTypes, tiktokURLType];
}

// Merge TikTok query schemes with existing schemes instead of overwriting
const tiktokSchemes = [
'tiktokopensdk',
'tiktoksharesdk',
'snssdk1180',
'snssdk1233',
];
const existingSchemes = config.modResults.LSApplicationQueriesSchemes || [];
const mergedSchemes = [...new Set([...existingSchemes, ...tiktokSchemes])];
config.modResults.LSApplicationQueriesSchemes = mergedSchemes;

return config;
});

config = withProjectBuildGradle(config, (config) => {

Check warning on line 44 in plugin/src/withTiktok.ts

View workflow job for this annotation

GitHub Actions / lint

'config' is already declared in the upper scope on line 10 column 3
const buildGradle = config.modResults.contents;
const mavenRepo = `maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" }`;

Expand All @@ -40,7 +53,7 @@
return config;
});

config = withAndroidManifest(config, (config) => {

Check warning on line 56 in plugin/src/withTiktok.ts

View workflow job for this annotation

GitHub Actions / lint

'config' is already declared in the upper scope on line 10 column 3
const mainApplication = AndroidConfig.Manifest.getMainApplicationOrThrow(
config.modResults
);
Expand Down
Loading