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

RMET-3367 H&F Plugin - Prepare to release version 2.1.0 #140

Merged
merged 58 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0b3fac8
chore: Add Unreleased Tag to CHANGELOG
OS-ricardomoreirasilva Nov 9, 2022
0796245
feat: iOS Workouts (#88)
OS-ricardomoreirasilva Jan 6, 2023
d691e84
chore: Set Release Tag
OS-ricardomoreirasilva Jan 10, 2023
367c167
RMET-2036 :: Replaced jcenter by mavenCentral (#87)
alexgerardojacinto Dec 19, 2022
ba296b8
chore(release): raise to version 1.2.12
alexgerardojacinto Dec 19, 2022
91682ca
chore: Set Release Tag
OS-ricardomoreirasilva Jan 10, 2023
891c1d1
chore: Update iOS Library (#90)
OS-ricardomoreirasilva Jul 31, 2023
0736ce8
chore: Update iOS Library (#91)
OS-ricardomoreirasilva Aug 1, 2023
c9286f3
RMET-2723 Health & Fitness Plugin - Disconnect from google fit (#92)
alexgerardojacinto Aug 25, 2023
0311bcf
chore: update library version
alexgerardojacinto Aug 25, 2023
8107fb4
chore: Update iOS xcframework (#94)
OS-ricardomoreirasilva Aug 28, 2023
18124cb
Prepare Release 1.3.0 (#89)
OS-ricardomoreirasilva Jan 10, 2023
d5a2476
chore(release): raise to version 1.4.0
alexgerardojacinto Aug 28, 2023
a9decc1
RMET-3046 H&F Cordova Plugin - Migrate RequestPermissions to HealthCo…
alexgerardojacinto Feb 2, 2024
259865d
RMET-3049 OSHealthFitnessLib-Android - Migrate WriteProfileData featu…
alexgerardojacinto Feb 6, 2024
ba8ff7a
RMET-3048 :: Migrate GetLastRecord to HealthConnect (#98)
alexgerardojacinto Feb 8, 2024
79b8e90
RMET-3069 H&F Plugin - Migrate ListBackgroundJobs feature (#99)
alexgerardojacinto Feb 12, 2024
4dd510e
RMET-3050 H&F Plugin - Migrate set background job (#101)
alexgerardojacinto Feb 20, 2024
80fbe75
RMET-3047 Android Advance Query (#100)
hectorjdgdev Feb 21, 2024
adb8e9c
RMET-3067 H&F Plugin - Migrate updateBackgroundJob (#103)
alexgerardojacinto Feb 22, 2024
8338a31
RMET-3068 ::: Android ::: Migrate Delete Background Jobs (#104)
OS-ricardomoreirasilva Feb 23, 2024
270597f
RMET-3145:::Show app's privacy policy dialog (#105)
hectorjdgdev Feb 27, 2024
5211a78
RMET-3158 H&F Plugin - Open Health Connect App (#107)
alexgerardojacinto Feb 29, 2024
8f24133
RMET- 3142 H&F Plugin - Hook for permissions (#106)
alexgerardojacinto Feb 29, 2024
e14d50b
RMET-3070 H&F Plugin - Implement disableHealthConnect feature and Dep…
ItsChaceD Mar 11, 2024
cab570b
RMET-3190 OSHealthFintessLib-Android - Fix library build (#108)
alexgerardojacinto Mar 11, 2024
64c0cfc
RMET-3190 H&F Plugin - Use exact alarms for background jobs (#109)
alexgerardojacinto Mar 15, 2024
d4df368
RMET-3191 H&F Plugin - Use sensors for background jobs (Activity Reco…
alexgerardojacinto Mar 20, 2024
4431361
chore: update dependency to H&F Android library (#112)
alexgerardojacinto Mar 21, 2024
c2b2182
RMET-3246 H&F Plugin - Fix hook for ODC (#113)
alexgerardojacinto Mar 22, 2024
91e2492
RMET-3134 H&F Plugin - Remove old code (#114)
alexgerardojacinto Apr 1, 2024
4c6ddc5
RMET-3134 H&F Plugin - Minor fix for background jobs feature (#115)
alexgerardojacinto Apr 3, 2024
f262aff
RMET-3134 H&F Plugin - Apply fix background job (#116)
alexgerardojacinto Apr 3, 2024
be2817d
chore: remove unused stuff (#117)
alexgerardojacinto Apr 3, 2024
f084e3e
refactor: update gson lib version (#119)
alexgerardojacinto Apr 4, 2024
8c4d950
RMET-3134 H&F Plugin - Fix privacy policy opening for Android <= 13 (…
alexgerardojacinto Apr 5, 2024
2a34f20
RMET-3280 ::: iOS ::: Add Privacy Manifest (#118)
OS-ricardomoreirasilva Apr 8, 2024
632c9a1
chore: update H&F Android library version (#121)
alexgerardojacinto Apr 8, 2024
e5e82c7
RMET-3051 H&F - Prepare release of version 2.0.0 (#123)
alexgerardojacinto Apr 9, 2024
d3857b2
Solve conflicts (#125)
OS-ricardomoreirasilva Apr 9, 2024
19552fd
Final try (#127)
OS-ricardomoreirasilva Apr 9, 2024
af010f0
chore: update changelog
alexgerardojacinto Apr 9, 2024
ec9b6c9
Merge branch 'main' into development
alexgerardojacinto Apr 9, 2024
e9ed2a1
chore(release): raise to version 2.0.0 (#130)
alexgerardojacinto Apr 9, 2024
19d4ce1
feat: update error messaging
OS-martacarlos Apr 24, 2024
332617d
Merge pull request #133 from OutSystems/feat/RMET-3388/update-error
OS-martacarlos Apr 29, 2024
7297791
RMET-3414 HealthFitness Plugin - Fix advancedQuery for percentage val…
alexgerardojacinto May 9, 2024
9e0c887
RMET-3363 - Add OxygenSaturation Permissions
ItsChaceD May 13, 2024
ac7953c
feat: update dependency to OSHealthFitnessLib-Android
alexgerardojacinto May 13, 2024
a80067a
chore: update dependency to OSHealthFitnessLib-Android
alexgerardojacinto May 15, 2024
334bd05
chore: update dependency to OSHealthFitnessLib-Android
alexgerardojacinto May 15, 2024
de0bac4
chore: update changelog
alexgerardojacinto May 15, 2024
d0939dc
Merge pull request #137 from OutSystems/feat/RMET-3355/update-lib
alexgerardojacinto May 15, 2024
7e77c3e
Merge branch 'main' into feat/RMET-3367/solve-conflicts
alexgerardojacinto May 20, 2024
6c60d21
chore: raise to version 2.1.0
alexgerardojacinto May 20, 2024
c876ff5
RMET-3406 ::: Android ::: Add More Verifications for Privacy Policy F…
OS-ricardomoreirasilva May 20, 2024
42104fb
Merge branch 'development' into feat/RMET-3367/solve-conflicts
alexgerardojacinto May 20, 2024
84540d5
Merge pull request #138 from OutSystems/feat/RMET-3367/solve-conflicts
alexgerardojacinto May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

The changes documented here do not include those from the original repository.

## [2.1.0]

### 2024-05-09
- Fix: Add format verification for Android's Privacy Policy file (https://outsystemsrd.atlassian.net/browse/RMET-3406).
- Feat: Implemented support for `OxygenSaturation` variable when using requestPermissions, advancedQuery, getHealthData, and background jobs (https://outsystemsrd.atlassian.net/browse/RMET-3363).

### 2024-05-09
- Fix: Use proper unit for percentage values (https://outsystemsrd.atlassian.net/browse/RMET-3414).

### 2024-04-24
- Chore: Update cordova hooks with new OutSystems specific errors. (https://outsystemsrd.atlassian.net/browse/RMET-3388).

## [2.0.0]

### 2024-04-05
Expand Down
9 changes: 8 additions & 1 deletion hooks/androidCopyPreferencesPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ let permissions = {
writePermission: "android.permission.health.WRITE_DISTANCE",
configValue: undefined,
wasSet: false
},
OxygenSaturation: {
variableName: "OxygenSaturation",
readPermission: "android.permission.health.READ_OXYGEN_SATURATION",
writePermission: "android.permission.health.WRITE_OXYGEN_SATURATION",
configValue: undefined,
wasSet: false
}
}

Expand All @@ -114,7 +121,7 @@ let groupPermissions = {
variableName: "HealthVariables",
configValue: undefined,
wasSet: false,
groupVariables: ["HeartRate", "Sleep", "BloodPressure", "BloodGlucose"]
groupVariables: ["HeartRate", "Sleep", "BloodPressure", "BloodGlucose", "OxygenSaturation"]
},
ProfileVariables: {
variableName: "ProfileVariables",
Expand Down
30 changes: 17 additions & 13 deletions hooks/androidCopyPrivacyUrlEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ const path = require('path');
const { ConfigParser } = require('cordova-common');
const et = require('elementtree');
const { fileExists } = require('./utils');

let fileNamePrivacyPolicy = "HealthConnect_PrivacyPolicy.txt";
let mainFolder = "platforms/android/app/src/main/";

module.exports = async function (context) {
const projectRoot = context.opts.cordova.project ? context.opts.cordova.project.root : context.opts.projectRoot;
const platformPath = path.join(projectRoot, `platforms/android/app/src/main/assets/www/${fileNamePrivacyPolicy}`);
const directoryPath = path.join(projectRoot, mainFolder);
const platformPath = path.join(directoryPath, `assets/www/${fileNamePrivacyPolicy}`);

if (fileExists(platformPath) || policyFileExists()) {
if (fileExists(platformPath) || policyFileExists(directoryPath)) {
const configXML = path.join(projectRoot, 'config.xml');
const configParser = new ConfigParser(configXML);

setPrivacyPolicyUrl(configParser, projectRoot);
} else {
throw new Error("Privacy Policy file not found in the resources folder.");
throw new Error("OUTSYSTEMS_PLUGIN_ERROR: Privacy Policy file not found in the resources folder.");
}
};

Expand All @@ -27,34 +30,35 @@ function setPrivacyPolicyUrl(configParser, projectRoot) {

if (hostname && applicationNameUrl) {
const url = `https://${hostname}/${applicationNameUrl}/${fileNamePrivacyPolicy}`;
const stringsPath = path.join(projectRoot, 'platforms/android/app/src/main/res/values/strings.xml');
const stringsPath = path.join(projectRoot, mainFolder, 'res/values/strings.xml');
const stringsFile = fs.readFileSync(stringsPath).toString();
const etreeStrings = et.parse(stringsFile);

let privacyPolicyUrl = etreeStrings.find('./string[@name="privacy_policy_url"]');
if (!privacyPolicyUrl) {
console.error('Privacy policy URL string not found in strings.xml');
return;
throw new Error (`OUTSYSTEMS_PLUGIN_ERROR: Privacy policy URL string not found in strings.xml.`)
}
privacyPolicyUrl.text = url;
const resultXmlStrings = etreeStrings.write({method: 'xml'});
fs.writeFileSync(stringsPath, resultXmlStrings);
} else {
throw new Error("Error getting the environment variables.");
throw new Error(`OUTSYSTEMS_PLUGIN_ERROR: Error getting the environment variables.`);
}
}

function policyFileExists() {
const directoryPath = 'platforms/android/app/src/main/assets/www';
const searchString = 'HealthConnect_PrivacyPolicy';
function policyFileExists(platformPath) {
const directoryPath = path.join(platformPath, 'assets/www');
// splits the file in name & format.
const searchStrings = fileNamePrivacyPolicy.split('.');

try {
const files = fs.readdirSync(directoryPath);
const matchingFiles = files.filter(fileName => fileName.includes(searchString));
const matchingFiles = files.filter(fileName => fileName.startsWith(searchStrings[0]) && fileName.endsWith(searchStrings[1]));

// return true if there are matching files, false otherwise
return matchingFiles.length > 0;
} catch (error) {
console.error('An error occurred:', error);
return false;
console.error(error);
throw new Error(`OUTSYSTEMS_PLUGIN_ERROR: An expected error occurred - Please check the logs for more information.`);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.outsystems.plugins.healthfitness",
"version": "2.0.0",
"version": "2.1.0",
"description": "Health & Fitness cordova plugin for OutSystems applications.",
"keywords": [
"ecosystem:cordova",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin id="com.outsystems.plugins.healthfitness" version="2.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="com.outsystems.plugins.healthfitness" version="2.1.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>HealthFitness</name>
<description>Health &amp; Fitness cordova plugin for OutSystems applications.</description>
<author>OutSystems Inc</author>
Expand Down
2 changes: 1 addition & 1 deletion src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies{

implementation("com.github.outsystems:oscore-android:1.2.0@aar")
implementation("com.github.outsystems:oscordova-android:2.0.1@aar")
implementation("com.github.outsystems:oshealthfitness-android:2.0.0@aar")
implementation("com.github.outsystems:oshealthfitness-android:2.1.0@aar")
implementation("com.github.outsystems:osnotificationpermissions-android:0.0.4@aar")

// activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>OSHealthFitnessLib.framework/OSHealthFitnessLib</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
Expand All @@ -20,6 +22,8 @@
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>OSHealthFitnessLib.framework/OSHealthFitnessLib</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
Expand Down
Binary file not shown.
Binary file not shown.
Loading