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 00293d7 commit aaa6991
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The changes documented here do not include those from the original repository.

## [Unreleased]

## 09-01-2023
- Fix: [iOS] Add `post_install` script to podfile in order to fix a XCode 14 code signing issue on Stripe's libraries.

## 06-01-2023
- Feat: [iOS] Add access token to Full Payment Process (https://outsystemsrd.atlassian.net/browse/RMET-2147).

Expand Down
18 changes: 18 additions & 0 deletions hooks/ios/iOSCopyPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const et = require('elementtree');
const path = require('path');
const fs = require('fs');
const plist = require('plist');
const child_process = require('child_process');
const { ConfigParser } = require('cordova-common');
const { Console } = require('console');

Expand Down Expand Up @@ -150,4 +151,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 aaa6991

Please sign in to comment.