ionic-team / ionic-package-hooks Goto Github PK
View Code? Open in Web Editor NEWCordova hooks that you can run in Ionic Package
License: Other
Cordova hooks that you can run in Ionic Package
License: Other
Hi,
regarding android_custom_resources.js
, how should I name the several custom icon file that I put in the resources/android/custom folder so that they go to the right drawable-* folder ?
I am working with OneSignal notifications, as you can see here they mention several size for the icons files.
Or maybe do I have to only use one format and this hook takes care of degrading the file to other resolutions ?
I tried to put all the drawable-* folders containing their respective custom icon to resources/android/custom but it doesn't work with ionic package...
Thanks
I'm having trouble running the hooks.
Am I doing something wrong?
Script file does't exist and will be skipped: /home/package/workspace/ionic_dash-857a12a1-41/cordova/package-hooks/009_remove_values.js
Script file does't exist and will be skipped: /home/package/workspace/ionic_dash-857a12a1-41/cordova/package-hooks/010_add_platform_class.js
Script file does't exist and will be skipped: /home/package/workspace/ionic_dash-857a12a1-41/cordova/package-hooks/011_change_api_url.js
Script file does't exist and will be skipped: /home/package/workspace/ionic_dash-857a12a1-41/cordova/package-hooks/012_remove_script_index.js
We need to be able to add values to LSApplicationQueriesSchemes. We were previously doing this by using this script https://gist.github.com/marcocarnazzo/6f01a57d390e8fe3071f . It basically allows for you to put in your config.xml something like
twitterand then after the hook runs it would have updated your plist file and appended the following:
LSApplicationQueriesSchemes
dps.f1f0ea0e-c7fc-484e-a577-b96ae276e380
This is a major issue for us because we need to be able to add QuerySchemes so we can check if an app is installed on a device.
The https://github.com/samzilverberg/cordova-mixpanel-plugin needs this setting in order to compile, is there a template or example I can use to create the hook and then make it available?
Steps:
Just add a sentinel to the ios hooks and vice versa. Should be able to check CORDOVA_PLATFORMS
env variable, which is a comma-separated list.
Hi,
I would like to clarify something (got a bit confused in the readme):
Any file (hook) in the root of this repo could be used as a hook during ionic package? using the following:
<hook type="after_prepare" src="package-hooks/<hook_file_name>" />
Without adding any file to my local (development) repository?
So, if I require to run a hook to solve a particular problem, I should submit it as a hook file in a PR to this repo?
Thanks!
EDIT: Also, how can we confirm if a package hook ran during ionic package or not?
Not sure if this is just because of my local versions of cordova and ionic-cli, but any javascript hook called out in the config.xml file must be configured as a node module (as seen here). I noticed this after attempting to integrate android_ignore_translation_errors.js
into my actual project. It failed but locally and with ionic package build android -p ### --release
. It's hard to confirm that the ionic package failed attempts were because of this since I can only see the build error, but it was the same build error as I was getting when running ionic build android --release
. After investigating I noticed only hooks in the hooks/after_prepare
directory or .sh
hooks included in the config.xml file were executing. the following seemed to fix my issue locally.
// add additional build-extras.gradle file to instruct android's lint to ignore translation errors
// v0.1.c
// causing error in the build --release
// Issue: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/80
//
// Warning: This solution does not solve the problem only makes it possible to build --release
module.exports = function(ctx){
// make sure android platform is part of build
if(ctx.opts.platforms.indexOf('android') < 0){
return;
}
var fs = ctx.requireCordovaModule('fs'),
path = ctx.requireCordovaModule('path'),
deferral = ctx.requireCordovaModule('q').defer();
var rootdir = path.join(ctx.opts.projectRoot, 'platforms/android');
if(rootdir){
var platforms = ctx.opts.platforms;
for(var x = 0; x < platforms.length; x++){
var platform = platforms[x].trim().toLowerCase();
try{
if(platform == 'android'){
var lintOptions = 'android { \nlintOptions {\ndisable \'MissingTranslation\' \ndisable \'ExtraTranslation\' \n} \n}';
fs.appendFileSync('platforms/android/build-extras.gradle', lintOptions, 'UTF-8');
console.log('Added build-extras.gradle ');
deferral.resolve();
}
}
catch(e){
console.log(e);
}
}
}
return deferral.promise;
};
Script is being called, folder resources/android/custom/ exists, but files inside are not copied to platforms/android/res/drawable-*
Hello everyone,
i get this error using the copy_google_services hook for ios package operation on the Ionic Cloud Service:
iOS project created with [email protected]
Error: Invalid data, chunk must be a string or buffer, not object.
I put the hook in the config.xml as described, and copy the GooglePlist file into the www folder.
Thank for the help.
Best regards.
Hi. I'm not experienced on pull requests so I expose my problem in this issue.
I successfully built an iOS app with "ionic package" on developer mode. I created my credentials to build a release version and I got the following error when running "ionic package build ios --profile production --release":
Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
Details can be seen on this issue ionic-team/legacy-ionic-cloud#129
After some research, the problem seems to be with Apple WWDR certificate being expired on ionic cloud. A solution using a before_install hook is explained here fastlane-old/gym#100 (comment)
Unfortunately ionic package does not accept developer hooks, so I would like to ask for such a hook to be added on ionic-package-hooks as it seems to be the only alternative to successfully build an iOS release IPA file.
I don't know if I can upload the hook by myself so it is avaliable on "ionic package". If it is, I'm willing to do it myself if someone can give me some hints. I Hope someone can help on solving this issue.
Best regards.
Hi,
Sorry, this might be a dumb question: if I wanted to include the hooks for the Branch.io plugin ( https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/tree/master/hooks ), how would I do that?
Can I just include them in my project folder before running "ionic package"? Or do I need to submit them here for review?
Regards,
Andy
Hi there!
I'm not sure if this is possible, but I am trying to include a Push Notification icon (for Android) with my ionic package build to ensure I don't just get a white square.
I have the proper icon in the /resources
folder along with my app icons generated through ionic resources
. I also have an after_prepare
hook that will copy the notification icon into the proper platform/android/res
folder, but I can't seem to use it with ionic package.
So my question is, is it possible to supply a custom hook for use with ionic package? Or, if not, is there a way for me to include the push notification icon in the build that gets sent to ionic package?
Thanks!
The script currently loops through platforms though anyway it is only modifying android specific files. It could just modify the android files directly.
We just added a PR with a hook that solves the bug on ionic cloud builds when using deeplinks plugin. Related issues are linked to the PR.
#41
Hope you can review it and add it to the repo soon, if not... deeplinks plugin doesn't work on cloud builds... which is not a good thing :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.