Skip to content

Commit

Permalink
feat: Post_install for MABS 9 (#24)
Browse files Browse the repository at this point in the history
Add a `post_install` script to overcome an issue in Xcode 14 when Pods require a provisioning profile for code signing (such as Stripe).
  • Loading branch information
OS-ricardomoreirasilva committed Apr 10, 2024
1 parent 9a65454 commit 61b6dc7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hooks/ios/iOSCopyPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,21 @@ module.exports = function (context) {
releaseEntitlements['com.apple.developer.in-app-payments'] = [merchant_id];

fs.writeFileSync(releaseEntitlementsPath, plist.build(releaseEntitlements, { indent: '\t' }));

// Change podfile.
// This is included due to a bug on xCode 14 related with code signing for pods that require a provisioning profile.
var podfilePath = path.join(platformPath, 'Podfile');
var podfileContents = fs.readFileSync(podfilePath).toString();
podfileContents = podfileContents.concat(`
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end`);
fs.writeFileSync(podfilePath, podfileContents);
child_process.execSync("pod install", { cwd: platformPath });
};

0 comments on commit 61b6dc7

Please sign in to comment.