-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
The TypeScript definition for URLScheme in expo/config-plugins does not include CFBundleTypeRole, which causes a TypeScript error when trying to add this property to the CFBundleURLTypes array in Info.plist.
Config Plugin
@config-plugins/apple-settings
What platform(s) does this occur on?
iOS
SDK Version
~52.0.17
Reproducible demo
Follow untill this step Create an app.plugin.js file in the root directory
paste into plugin/src/index.ts
import {
ConfigPlugin,
createRunOncePlugin,
withInfoPlist,
} from "expo/config-plugins";
// Get the package.json version and name
const pkg = require("../../package.json");
const withLineSDK: ConfigPlugin = (config) => {
// Use withInfoPlist to modify the Info.plist file
return withInfoPlist(config, (config) => {
// Get the existing Info.plist
const infoPlist = config.modResults;
// Add CFBundleURLTypes if it doesn't exist
if (!Array.isArray(infoPlist.CFBundleURLTypes)) {
infoPlist.CFBundleURLTypes = [];
}
// Add LINE URL scheme configuration
infoPlist.CFBundleURLTypes.push({
CFBundleTypeRole: "Editor", // Error 'CFBundleTypeRole' does not exist in type 'URLScheme'.
CFBundleURLSchemes: [
`line3rdp.${config.ios?.bundleIdentifier || "$(PRODUCT_BUNDLE_IDENTIFIER)"}`,
],
});
return config;
});
};
export default createRunOncePlugin(withLineSDK, pkg.name, pkg.version);You will get 'CFBundleTypeRole' does not exist in type 'URLScheme'.
I use @ts-ignore as a workaround but can we have CFBundleTypeRole in URLScheme?

Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working