Read config settings from PhoneGap app - ios

Apparently I'm terrible at Googling. All I want to do is have the ability to read my web service URL from a config file in my PhoneGap app. Also, be able to modify that value during the build process. Is this named alot different in Xcode? I think I need to save this value in the plist file. If that's the case, then I can just set a user-setting in my build configuration stuff to have it change depending on which build type, Dev/Release.
If that's true, how do I access this from PhoneGap?
I'm guessing this question will get closed, but where else do I go for help...

plist file for cordova project already depreciate since v2.2. Cordova v2.3 start using config.xml.
Target > Edit Scheme

You could probably use hooks to accomplish everything that you are trying to do without changing around the config.xml file, but I'm not entirely sure this is supported with Phonegap (it is with Cordova.)
Check out the official help page to use the /hooks/ folder to modify anything during the build process: https://github.com/apache/cordova-cli/blob/master/templates/hooks-README.md
This blog post also seems pretty useful: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ it talks about changing things based on the environment and I'm sure it'd be easy to extend that to changing based on dev/release.
You could store the link to your web service probably as a config variable. I'm trying to figure out how you can add a config variable and will report back if I get it. In the mean time you could probably just have something like a server.txt file that you change with hooks.

Related

Reading an app setting value from iOS Settings-MyApp using Ionic

I want to create a app specific setting(app preference) in iOS(iPad) and read that in my Ionic(v5) code. I have seen plugins like https://github.com/chrisekelley/AppPreferences/ this but not working with the cordova-9 as it was not updated. Looks like this project is abandoned.I was able to create a setting bundle during the build and place it under the settings->Myapp (key-value) but from the program reading is not working.
My requirement is very simple. I need to externalize the back-end server IP/name as it might change sometimes. I was thinking if I can create a property under Settings->MyApp->Server then I can edit it in the Settings and read it while starting the app.
Is there a different approach that I can follow?
Please let me know if you have any pointers.

Way to change info.plist value without giving new build

I have a function who is getting Base Url from info.plist's configuration key. I forgot to change that to Production and was in Staging state at the time of generating my build and now it is using development base url.
So is there any way to change that without giving a new build as it is very small change and for one thing i don't wish to publish a new build. I know it is not possible but still if anyone have any other solution, would be great help to me.
Your info.plist is part of the signed bundle. To change it you need to create a new build.
The only workaround that comes in my mind, you can make a 301-redirect from your stage to production.

Jenkins: File Operations Plugin

I just started with using jenkins, and learning a lot.
Installed on windows 7.
One thing i can figure out is about File operations plugin.
I don't know how to set up just simple "copy, paste" from one location to another.
Yea maybe is dumb, but i just cant figure out, try a lot of and always got build break.
What i need to set up for simple test ? like i liked to say, show me a door, i'll figure out rest :)
The include file pattern wants an ANT style filter (relative to your workspace as the root).
Include File Pattern: myWorkspaceSubFolder\*.txt
Target location also assumes the root workspace though I guess you can redirect it to another drive.

Where is the default login page for the spring security core plugin?

I have installed the spring security core plugin. I need to modify the login page to look like my existing website. I have searched the entire project and cannot find it. I am running grails 2.4 and spring-security-core:2.0-RC5. Where can this pesky little file be? Can someone who is not a complete greenhorn help a fellow out?
As #Abs points out, the file is at target/work/plugins/spring-security-core-2.0-RC5/grails-app/views/login/auth.gsp but you shouldn't edit plugin files. Other developers on your team won't have access to the modified files and if you delete the target directory you'll lose your changes since the target directory is only a temporary work location.
Instead, copy the file to the same relative location in your application and make changes there. Create grails-app/views/login and copy the file there and make whatever changes you want.
This technique works for most plugin files, not just GSPs. The compilation order and classpath are configured such that application files and classes override plugin files if they're in the same location/package.
You can find the default login page here
targt->work->plugins->spring-security-core-2.0-RC5->grails-app->views->login>auth.gsp

May I use sf_sandbox directly as my symfony project?

As sf_sandbox has set up the symfony environment, why not develop in the sandbox directly and then upload on to server? What are the disadvantages of sandbox compared with configuring manually?
I think there is no drawback in following this approach. sf_sandbox is a pre-configured symfony project. One of the pluses is that is saves you time in creating your project and initializing an empty application (by default this is called frontend).
It's more a matter of taste rather than a matter of right or wrong. It's up to you!
Note: If you follow this approach you have to make some initial configuration (steps 1,2,3 would be done anyway if you started your project from scratch):
Rename the project
Change the config/properties.ini file
Change the config/databases.yml file (by default sf_sandbox uses sqlite database)
Remove the data/sandbox.db database file

Resources