Latest 3.0-preview.4
Homepage https://github.com/Microsoft/healthvault-ios-sdk
License APACHE
Platforms ios 8.0, requires ARC
Frameworks UIKit, Security, MobileCoreServices, SystemConfiguration
Authors

About

HVLib is a static iOS library you use to build applications for Microsoft HealthVault. HVLib was originally developed for and is actively used by the Microsoft HealthVault for iPhone app.

HVLib introduces a rich new HealthVault iOS client programming model. It includes built in serialization of most HealthVault data types, and built in support for HealthVault methods. You no longer need to manually parse or create XML.

HealthVault data types are automatically serialized/deserialized from their native XML into Objective-C objects. These objects include programming model to assist with data manipulation. HVLib also supplies support for local HealthVault data storage, and in the future, synchronization.

64 Bit Support

The latest iOS SDK version supports both 32 and 64 bit applications.

Sample Code

See HVLib/Samples/HelloHealthVault for sample code.

HelloHealthVault

  • Samples/HelloHealthVault.xcworkspace

The HelloHealthVault sample demonstrates how to add, remove, update and query Health information to and from HealthVault.
To run the sample, make sure you load the WORKSPACE – (HelloHealthVault.xcworkspace) – so that dependencies and libraries are correctly pulled in.

HelloHealthVault uses a pre-defined HealthVault application.
You can create your own applications using the HealthVault Application Configuration Center.

SDK Features Sample App

  • Samples/SDKFeatures.xcworkspace

The rich SDKFeatures sample demonstrates how to view, create, update and delete most core HealthVault types, including blood pressure, medication, conditions, procedures, immunizations, blood glucose, exercise and diet. It also shows you how to manage files – view, download and upload files in HealthVault.

SDKFeatures also demonstrates how to de-authorize your application from HealthVault.

Using HVLib with your Project

You should link HVLib as a static library into your project.

  1. Make sure you are using Xcode workspaces. If not, create a new workspace and add your project to it.
  2. Add HVLib.xcodeproj to your Workspace

iOS Framework Dependencies

  • libxml2.2.dylib OR libxml2.2.tbd (depending on your XCODE version) [This is part of the core iOS SDK]
  • Security.Framework
  • MobileCoreServices.Framework
  • SystemConfiguration.Framework

Header Files

//
// Include HealthVault Library
//
#import "HVLib.h"

Update Build Targets

Make the following changes to your project Target:

Build Phases

  • Link Binary With Libraries
  • Add libHVLib.a [This is the HealthVault Library. You should see it listed under "Workspace"]
  • Add libxml2.2.dylib OR libxml2.2.tbd (depending on your XCODE version) [This is part of the core iOS SDK]
  • Security.Framework
  • SystemConfiguration.Framework
  • MobileCoreServices.Framework

Build Settings

  • Architectures
    • Set your Architectures to Standard architectures (armv7, arm64) – $(ARCHS_STANDARD)
    • Build Active Architectures Only — NO
    • Set Code Generation -> No Common Blocks to NO

Linking

Add the following flags under the "Other Linker Flags" section:

  • ObjC

Search Paths

Add the following flags within the "Header Search Paths" section:

  • $(SDK_DIR)/usr/include/libxml2/**
  • User Header Search Paths:
    • Add Relative Path to the HVLib directory. E.g. HealthVault samples use the path:
      • ../../HVLib/ [Note: Xcode may add the for you by default – i.e. search all subdirectories of the path]
      • OR: ../HVMobile_VNext/**

        ClientSettings.xml

  • HVLib loads settings from ClientSettings.xml. Please add ClientSettings.xml to your project.
  • You can leverage the one included with the HelloHealthVault sample.
<?xml version="1.0" encoding="utf-8" ?>
<clientSettings>
    <!--
        HealthVault Application ID
     This is the app ID for the default sample Hello World application. 
     Create your own application athttp://config.healthvault-ppe.com
     -->
    <masterAppID>cf36aef7-5d87-4688-88b2-f9b57c086d7d</masterAppID>
    <!--Application name -->
    <appName>Hello Healthvault</appName>
    <!--
        Url for HealthVault service calls - set up for Pre-Production below
     -->
    <serviceUrl>https://platform.healthvault-ppe.com/platform/wildcat.ashx</serviceUrl>
    <!--
        HealthVault Shell - used during app provisioning on the device
     -->
    <shellUrl>https://account.healthvault-ppe.com</shellUrl>
</clientSettings>

Contribute

Contributions to HVMobile_VNext are welcome. Here is how you can contribute:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Latest podspec

{
    "name": "HealthVault",
    "version": "3.0-preview.4",
    "summary": "An iOS framework you can use to build applications that leverage the Microsoft HealthVault platform",
    "description": "The healthvault-ios-sdk framework simplifies developing apps that use the Microsoft HealthVault platform. It handles authenticating users, managing credentials, serializing data types and much more.",
    "homepage": "https://github.com/Microsoft/healthvault-ios-sdk",
    "license": {
        "type": "APACHE",
        "file": "LICENSE"
    },
    "authors": {
        "Microsoft": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Microsoft/healthvault-ios-sdk.git",
        "tag": "3.0-preview.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "libraries": "xml2",
    "xcconfig": {
        "HEADER_SEARCH_PATHS": "$(inherited) $(SDKROOT)/usr/include/libxml2",
        "OTHER_LDFLAGS": "-lxml2"
    },
    "frameworks": [
        "UIKit",
        "Security",
        "MobileCoreServices",
        "SystemConfiguration"
    ],
    "default_subspecs": "CachingSupport",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "HealthVault/Classes/**/*.{h,m}",
            "exclude_files": "HealthVault/Classes/Caching/**/*.{h,m}",
            "private_header_files": "**/Private/**/*.h"
        },
        {
            "name": "CachingSupport",
            "resources": "HealthVault/Assets/MHVThingCacheDatabase.xcdatamodeld",
            "preserve_paths": "HealthVault/Assets/MHVThingCacheDatabase.xcdatamodeld",
            "source_files": "HealthVault/Classes/**/*.{h,m}",
            "private_header_files": "**/Private/**/*.h",
            "xcconfig": {
                "GCC_PREPROCESSOR_DEFINITIONS": "THING_CACHE=1"
            },
            "frameworks": "CoreData",
            "dependencies": {
                "EncryptedCoreData": [
                    "~> 3.1"
                ]
            }
        },
        {
            "name": "Tests",
            "source_files": "HealthVault/Classes/**/*.{h,m,xcdatamodeld}",
            "resources": "HealthVault/Assets/**/*",
            "xcconfig": {
                "GCC_PREPROCESSOR_DEFINITIONS": "THING_CACHE=1"
            },
            "frameworks": "CoreData",
            "dependencies": {
                "EncryptedCoreData": [
                    "~> 3.1"
                ]
            }
        }
    ]
}

Pin It on Pinterest

Share This