-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Supporting Custom Entitlements files #2075
Comments
@SpoonIsBad @enchev It also needs to add the CODE_SIGN_ENTITLEMENTS variable to the xcconfig This feature is necessary for CI builds because Xcode 8 no longer copies the entitlements from the provisioning profile. So, if for example, you are doing a CI build, it will have zero entitlements. This causes any plugins that use entitlements (i.e. push notifications) to break if built in a CI environment, where going into Xcode and toggling the entitlement in a GUI isn't possible. A |
For anyone else who needs to build in CI right now, this is what I use:
var fs = require('fs-extra');
var path = require('path');
module.exports = function(logger, platformsData, projectData, hookArgs) {
var platform = hookArgs.platform.toLowerCase(),
appResourcesDirectoryPath = projectData.appResourcesDirectoryPath,
platformResourcesDirectory = path.join(appResourcesDirectoryPath, "iOS");
return new Promise(function(resolve, reject) {
if (platform == 'ios') {
var target = path.join(platformResourcesDirectory, "build.xcconfig");
try {
fs.writeFileSync(target, "CODE_SIGN_ENTITLEMENTS = " + path.join(projectData.projectName, projectData.projectName + ".entitlements"));
} catch (error) {
reject();
}
}
resolve();
});
};
var fs = require('fs-extra');
var path = require('path');
module.exports = function(logger, platformsData, projectData, hookArgs) {
var platform = hookArgs.platform.toLowerCase(),
appResourcesDirectoryPath = projectData.appResourcesDirectoryPath,
entitlementsFile = path.join(appResourcesDirectoryPath, "iOS", ".entitlements"),
projectRoot = path.join(projectData.platformsDir, "ios"),
project = path.join(projectRoot, projectData.projectName);
return new Promise(function(resolve, reject) {
try {
if (fs.existsSync(entitlementsFile)) {
if (platform == 'ios') {
fs.copySync(entitlementsFile, path.join(project, projectData.projectName + ".entitlements"), { clobber: true });
}
}
} catch (error) {
console.error(error);
reject();
}
resolve();
});
}; You'll need to have a |
@vbresults tnx for the suggestion, I created a plugin based on your code! https://github.com/Essent/nativescript-custom-entitlements |
The script not function in my project. Is there any new solution to the problem? |
Can you please give us more info in order to help you to resolve the problem?
|
Is it possible to have a custom Entitlements.plist file in App_Resources like it is possible to have a custom Info.plist file? #1089
I tried dropping a Entitlements.plist in my App_Resources file, but when I navigate to platforms/ios/MyApp/ I notice there is no prepended MyApp-Entitlements.plist, and instead it still lives inside of the platforms/ios/MyApp/Resources/ folder. As a result I'm guessing the answer to my question is no.
EDIT
Upon messing with this more, I realize the correct file I need is a .entitlements file, not an entitlements.plist, in my case it'd be MyApp.entitlements
The text was updated successfully, but these errors were encountered: