Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS ::: Fix MABS 9 Build error #24

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
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
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 });
};