Git Product home page Git Product logo

Comments (5)

lehn0058 avatar lehn0058 commented on July 28, 2024

Did you get prompted for permission to use the camera? If permission is not given when the dialog is displayed, then the camera can't be used by the app. You can check the permissions under the settings app.

from atheartrate.

damyrm avatar damyrm commented on July 28, 2024

Thanks for your quick answer.
Did check in the settings but the camera's permission was given.
I'll try to start again from scratch with also an other device.

from atheartrate.

damyrm avatar damyrm commented on July 28, 2024

So tested on a fresh xcode installation, on a new git clone (+add previous code for viewController), on a new device with ios 9.2.
When I run:

  • (IBAction)Start:(id)sender {
    HeartRateDetectionModel *hr = [[HeartRateDetectionModel alloc]init];
    hr.delegate = self;
    [hr startDetection];
    }
    the flash starts, It ask me the authorisation to use for the camera: press OK,
    I get the delegate method firing:
    -(void)heartRateStart {
    NSLog(@"started!");
    self.label.text = @"started!";
    }
    The flash stop,
    Nothing else.

Settings privacy, camera enable for the project.
rerun the app, same flash for less a sec, label=started and nothing change.

tried with a device 7.1 (no cam permission), same result .

I'm pretty sure the problem comes from my side, but cannot find where.
Any other idea?

Thank you in advance.

from atheartrate.

lehn0058 avatar lehn0058 commented on July 28, 2024

I think I see your issue. HeartRateDetectionModel *hr is being released from memory right after you call start. You will need to keep an instance that stays around - probably as a property on the class your start method is in. Try something like this:

// At top of class file
@Propert (nonatomic, strong) HeartRateDetectionModel *hr;
...
...
...

  • (IBAction)Start:(id)sender {
    self.hr = [[HeartRateDetectionModel alloc]init];
    self.hr.delegate = self; [hr startDetection];
    }

from atheartrate.

damyrm avatar damyrm commented on July 28, 2024

It was exactly that.
Tested my heart rate with your app and the results are good.
Thank you for your help.

from atheartrate.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.