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
[cordova] add resource-file to mobile-config #9748
Conversation
@eskan This is looking great to me! Will you be able to update the documentation? |
@benjamn "Pas de soucis" |
@eskan this is awesome. In the meantime, is there another way to include |
@etyp unfortunately not. |
Got it. I managed to add the following to
And my Not sure if it's a separate issue, but @eskan is there any reason you can think of for that to not be a temporary workaround? (My assumption is that it doesn't work because of some other unrelated issue) |
hi @etyp, it's not a workaround to me as you need to put/change files in a temporary or autogenerated directory. But it could be a way to test notification with your plugin until this PR will be merged. |
tools/cordova/builder.js
Outdated
configureAndCopyResourceFiles(resourceFiles, iosElement, androidElement) { | ||
_.each(resourceFiles, resourceFile => { | ||
// copy file in cordova project root directory | ||
var filename = resourceFile.src.split('\\').pop().split('/').pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is this splitting/popping on resourceFile.src
in order to account for the different file path separators on Windows vs Unix, or is this because of something else I'm missing?
If it is because of such a reason, can we use Node's path.parse
instead? A backslash is an uncommon, but possible, character in a valid Unix path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abernix sorry for this ugly thing, i've updated the PR with path.parse()
regards
Please ignore the "waiting" tests. They will go away if you rebase this off the current |
…n/meteor into eskan/cordova-resource-file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eskan - we should be all set here. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Hi,
this PR allow to add resource files, see cordova documentation
there is a feature-request meteor/meteor-feature-requests#279
the added function is
App.addResourceFile(src,target,[platform]);
which will be translated in config.xml :
the App.addResourceFile target parameter is mandatory here as the resource will be copied first at the root of the cordova project. Then cordova builder will copy the file to the target destination.
Why resource-file is need ?
some plugin like cordova-plugin-firebase
need configuration file which is use by Google Services.
here is how to set configuration file for this plugin :
this will add
to the generated config.xml
What is missing ?
Documentation needs to be updated