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

ionic package build - can only have default settings #126

Open
4 of 16 tasks
recyclethis opened this issue Mar 31, 2017 · 6 comments
Open
4 of 16 tasks

ionic package build - can only have default settings #126

recyclethis opened this issue Mar 31, 2017 · 6 comments

Comments

@recyclethis
Copy link

Issue:
This is a great plugin, but I think it will not work with ionic package build service. I have updated app-settings.json, run cordova prepare, verified the output in platforms/ios/Settings.bundle but whenever I run ionic package build ios I always get an ipa with the the Title/Language/Debug settings shipped with the plugin. I don't believe there is anything this plugin can do either. The ionic build system does not upload local plugins, but uploads the config.xml and uses their version of the plugins. I believe the app-settings.json file is not uploaded, so this plugin during the prepare uses the default's shipped with the plugin. If anyone knows a way to workaround this that would be awesome, but otherwise I'm more or less just adding this here for the next schmuck who wastes a day and a half trying to get this to work.

Please specify your environment

Plugin version:

  • released version: ~0.99.3
  • repository master

Toolchain:

  • Cordova cli
  • Phonegap cli
  • Phonegap cloud
  • Ionic
  • Other: _____

Platforms affected:

  • Android
  • iOS/macOS
  • LocalStorage fallback for browser and blackberry
  • Windows and Windows Phone 8.1 and later
  • Windows Phone 8 and earlier (deprecated)

What the scope of your problem:

  • General functionality (store/fetch/remove/clearAll)
  • Suites
  • Cloud synchronization and events
  • Preferences pane generation and display
@janpio
Copy link

janpio commented Apr 4, 2017

A workaround would probably include finding another plugin that does something like what this app-settings.json achieves (defining some values that the plugin can use when running) and already works with Ionic Package. Then fork this plugin here and rebuild it to use the method of the other plugin. (This will probably include config.xml as replacement for app-settings.json)

(Idea: Maybe you can make app-settings part of your www and change the plugin to read from there?)

@recyclethis
Copy link
Author

Thanks @piotrowski. I think if the app-settings.json file were located in the src folder it would get uploaded to ionic package service; however, that service uses the npm version not local version of Cordova plugins, so I can't modify the plugin to read the settings from another location. I could create a hook in settings.xml that copies the file to where the plugin expects it, but ionic package system doesn't allow custom hooks. I would have to submit the hook to ionic for possible inclusion into their repository of approved hooks. Maybe this plugin could read the location of the app-settings.json file from the settings.xml file and use the root as a default, preventing this from being a breaking change.

That all said, I've completed the project I was working on without the app preferences. I was just putting this out here hoping someone with more experience with ionic package and Cordova had figured out something that already works. If I do another project that requires app preferences, and we still don't have a Mac, I'll create a pull request to set the location of the app-preferences.json in the settings.xml file.

@janpio
Copy link

janpio commented Apr 10, 2017

You would fork the plugin, make your changes, install the forked version in your project so Ionic Package would also use this adapted version of the plugin.

@recyclethis
Copy link
Author

From what I understand Ionic Package won't use local version's of Cordova plugins, but pulls it down from npm based on it being referenced in your settings.xml. I'll test that idea and see how it goes, but I think the changes won't be recognized by ionic package service.

@janpio
Copy link

janpio commented Apr 10, 2017

Ahh, most people don't know this but by using your Github URL when installing (ionic/cordova plugin add https://github.com/recyclethis/me.apla.cordova.app-preferences) instead of the npm string (cordova plugin add cordova-plugin-app-preferences) it actually adds this Github URL to the package.json (where it stores the names, versions and sources of plugins) which should also work on Ionic Package. Then it's not the 'local version' that is being used, but a different online version. (You could also add it to npm under a different name, but this mostly isn't necessary)

@recyclethis
Copy link
Author

OMG, thanks for that tip. Exactly why I was posting something out here. Hoping someone who knows more about this system would have a great suggestion like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants