Enables heart rate measurements in your app.
- User presses a button in your app
- Instant Heart Rate is launched, user measures his heart rate
- Result is returned to your app.
-
Copy AzumioConnect folder with files AZConnect.m/.h to your project
-
Add new URL schema to your info file. We recommend using your Bundle identifier which should be in the reverse domain notation ( com.azumio.iphone.AzumioConnectExample in our example app ) Hint: Step 5 at http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/
-
Add
si.modula.instantheartrate.free
andsi.modula.instantheartrate
toLSApplicationQueriesSchemes
in your Info.plist file -
Handle openUrl and redirect it to AZConnect -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{
[[AZConnect instance] openURL:url];
return YES;
}
-
Register a callback to receive the heart rate [[AZConnect instance] setHeartRateCallback:^(double heartRate) { heartrateLabel.text = [NSString stringWithFormat:@"%d bpm", (int)heartRate];
} andSchema:@"com.azumio.iphone.AzumioConnectExample"];
-
Trigger the measurement [[AZConnect instance] measureHeartRate];