Skip to content

Commit

Permalink
Prepare Release 1.3.0 (#89)
Browse files Browse the repository at this point in the history
* chore: Add Unreleased Tag to CHANGELOG

* feat: iOS Workouts (#88)

Update Health and Fitness iOS library in order to include the new GetWorkoutsData feature.
Add required code to bridge the feature between the callers (OutSystems) and iOS.

* chore: Set Release Tag

Set release tag on the repo's CHANGELOG file.

* chore: Set Release Tag

Set release tag on the repo's package.json and plugin.xml files.
  • Loading branch information
OS-ricardomoreirasilva authored Jan 10, 2023
1 parent 7e3d4b9 commit fc50c4e
Show file tree
Hide file tree
Showing 27 changed files with 860 additions and 111 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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.

## [Unreleased]
## [Version 1.3.0]
- Feat: [iOS] Add a method to retrieve workouts raw data from HealthKit (https://outsystemsrd.atlassian.net/browse/RMET-2128).

## [Version 1.2.12]

Expand Down
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": "1.2.12",
"version": "1.3.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="1.2.12" 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="1.3.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
27 changes: 24 additions & 3 deletions src/ios/OSHealthFitness.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class OSHealthFitness: CDVPlugin {
let fitnessVariables = command.arguments[2] as? String ?? ""
let healthVariables = command.arguments[3] as? String ?? ""
let profileVariables = command.arguments[4] as? String ?? ""
let summaryVariables = command.arguments[5] as? String ?? ""
let variable = VariableStruct(allVariables: allVariables, fitnessVariables: fitnessVariables, healthVariables: healthVariables, profileVariables: profileVariables, summaryVariables: summaryVariables)
let workoutVariables = command.argument(at: 6) as? String ?? ""
let variable = VariableStruct(allVariables: allVariables, fitnessVariables: fitnessVariables, healthVariables: healthVariables, profileVariables: profileVariables, workoutVariables: workoutVariables)

self.plugin?.requestPermissions(customPermissions:customPermissions, variable: variable) { [weak self] authorized, error in
guard let self = self else { return }
Expand Down Expand Up @@ -195,7 +195,7 @@ class OSHealthFitness: CDVPlugin {
self.callbackId = command.callbackId

let queryParameters = command.arguments[0] as? String ?? ""
if let params = queryParameters.decode() as QueryParameters? {
if let params = queryParameters.decode() as AdvancedQueryParameters? {

let variable = params.variable ?? ""
let startDate = params.startDate ?? ""
Expand Down Expand Up @@ -226,6 +226,27 @@ class OSHealthFitness: CDVPlugin {
}
}
}

@objc(getWorkoutData:)
func getWorkoutData(command: CDVInvokedUrlCommand) {
self.callbackId = command.callbackId

guard let arg = command.argument(at: 0) as? String, let queryParameters = arg.decode() as WorkoutAdvancedQueryParameters? else { return }
let workoutTypeVariableDictionary = queryParameters.workoutTypeVariableDictionary
let startDate = Date(queryParameters.startDate ?? "")
let endDate = Date(queryParameters.endDate ?? "")

self.plugin?.workoutAdvancedQuery(workoutTypeVariableDictionary: workoutTypeVariableDictionary, date: (startDate, endDate), completion: { [weak self] success, result, error in
guard let self = self else { return }

if success {
self.sendResult(result: result, error: nil, callBackID: self.callbackId)
} else {
self.sendResult(result: nil, error: error, callBackID: self.callbackId)
}
})

}
}

// MARK: - OSCommonPluginLib's PlatformProtocol Methods
Expand Down
10 changes: 5 additions & 5 deletions src/ios/frameworks/OSHealthFitnessLib.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>OSHealthFitnessLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OSHealthFitnessLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ SWIFT_CLASS("_TtC18OSHealthFitnessLib13BackgroundJob")
- (nonnull instancetype)initWithEntity:(NSEntityDescription * _Nonnull)entity insertIntoManagedObjectContext:(NSManagedObjectContext * _Nullable)context OBJC_DESIGNATED_INITIALIZER;
@end


@class NSString;
@class NSDate;
@class Notification;
Expand Down Expand Up @@ -249,6 +250,7 @@ SWIFT_CLASS("_TtC18OSHealthFitnessLib12Notification")
@end



@interface Notification (SWIFT_EXTENSION(OSHealthFitnessLib))
@property (nonatomic, copy) NSString * _Nullable body;
@property (nonatomic) int64_t id;
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fc50c4e

Please sign in to comment.