-
Notifications
You must be signed in to change notification settings - Fork 664
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
Variable for Require GPS Hardware #189
Conversation
Two main reasons:
|
Actually variables are defined in
example <plugin name="cordova-plugin-admob-free" spec="^0.21.0">
<variable name="ADMOB_APP_ID" value="ca-app-pub-****" />
</plugin>
<plugin name="cordova-android-support-gradle-release" spec="^3.0.1">
<variable name="ANDROID_SUPPORT_VERSION" value="28.+" />
</plugin>
<plugin name="cordova-android-play-services-gradle-release" spec="^2.0.0">
<variable name="PLAY_SERVICES_VERSION" value="+" />
</plugin>
<plugin name="cordova-android-firebase-gradle-release" spec="^2.0.0">
<variable name="FIREBASE_VERSION" value="+" />
</plugin>
<plugin name="cordova-plugin-facebook4" spec="4.1.0">
<variable name="APP_ID" value="***" />
<variable name="APP_NAME" value="***" />
<variable name="FACEBOOK_HYBRID_APP_EVENTS" value="false" />
<variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.38.1" />
</plugin> |
Actually as @jony89 also states |
Those aren't apache's codebases. I'm talking about consistency within the apache's repositories. Third-party plugins may choose whatever format they like to use. If you look at any other apache cordova plugin, you will see preference names defined in |
@sithwarrior can you please change rename the variable to |
@breautek Thats not the case for variables set at install time, that set native build settings, as mentioned earlier. Here from the cordova docs API_KEY Here from the apache cordova camera app Here from the apache cordova media app Also it dosent work with |
I'll try to take a look later tonight. Is there a reason why we are using a |
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.
Had a deep look at this, and I understand that this cannot actually be done using the config xml preferences as I was originally requesting, that it must be done using the --variable
switch because we need to use those variables during install time.
I don't really like it, as that means to change the variable, you must remove and re-add the plugin, but it is what is required.
You can also modify the PR description to include the following GH keywords:
closes #171
closes #86
closes #98
As this PR makes those PRs irrelevant.
Also would like to take the moment to thank everybody involved with their contributions and patience. I know I was being hard, I was just trying to ensure a certain level of quality and consistency. And obviously the way I wanted things done was not actually possible.
The tests are green and this PR defaults the required state to true to maintains backwards compatibility which makes this PR :+1 to me.
@erisu can we get a review on this? Right now i have to do hacky stuff to get my project built correctly, and this would fix that. |
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.
Besides the small README suggestion, LGTM!
I've done a quick test, the AndroidManifest file is changed as expected.
Unfortunately, my android devices all have GPS, so I can't really test this besides building the APK.
This was the extent to my testing. And I'm not entirely sure if the phone will let you install an APK even if you lack required features or not. This may also just be a google play store where the listing is simply hidden. So once the README has been updated as per your suggestion I'll merge this PR. |
Luckily Martin set the checkmark for "allow edit by maintainers". I've applied my small readme suggestion. Once the CI is green, feel free to merge. |
All green. Thanks @timbru31 for taking the time to review 🎉 |
This also closes https://issues.apache.org/jira/browse/CB-14255 |
Great stuff @breautek Any Idea, when this will be included in a new release, so we can use it, in our apps? |
We generally do not give any ETAs on new releases. You can always install the master with |
Still no eta on a proper release? I know I can install using the master branch, but that's basically the same thing, and setting your build setting to nightly, and sidesteps semver. |
Platforms affected
Android
Motivation and Context
Currently installing this plugin, has the sideeffect of your App only beeing installable on Android devices with GPS hardware. We have clients with tablets without GPS hardware.
closes #187
closes #171
closes #86
closes #98
Description
Added the variable GPS_REQUIRED so when installing the pluging, its optional if you want to require GPS Hardware on Android devices. Currently an app with this plugin, cannot run on devices without GPS Hardware, because of this setting in the plugin.xml
<uses-feature android:name="android.hardware.location.gps" />
Also added a description in the readme, under Android Quirks, as this only affects Android atm.
Naming of the variable is all caps, as is standard with install time variables, for editing the AndroidManifest.xml.
This PR is trying to finish the work in #171
Testing
Testing installing the plugin with and without the variable, and checked the resulting androidmanifest.xml and tested the resulting apk's.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)