iHealthDeviceLabs / iHealth-React-Native-SDK

3 stars 11 forks source link

Authentication failing with .pem file #3

Open created-by-varun opened 2 years ago

created-by-varun commented 2 years ago

Getting the Error code 13 and user authentication is failing (correct .pem file is downloaded from the dashboard and steps listed in the readme file are followed)

    if (data!=nil) {
        [[IHSDKCloudUser commandGetSDKUserInstance] commandSDKUserValidationWithLicense:data UserDeviceAccess:^(NSArray *DeviceAccessArray) {
            NSLog(@"DeviceAccessArray :%@",DeviceAccessArray);
        } UserValidationSuccess:^(UserAuthenResult result) {
            if (result==UserAuthen_LoginSuccess || result==UserAuthen_RegisterSuccess|| result==UserAuthen_TrySuccess ) {
                 [self.bridge.eventDispatcher sendDeviceEventWithName:kEvent_Authenticate_Result body:@{@"access":@1}];
            }else{   
                 [self.bridge.eventDispatcher sendDeviceEventWithName:kEvent_Authenticate_Result body:@{@"access":@0}];
            }
        } DisposeErrorBlock:^(UserAuthenResult errorID) {
            // code flow coming here with error code 13
             [self.bridge.eventDispatcher sendDeviceEventWithName:kEvent_Authenticate_Result body:@{@"access":@0}];
        }];

    }
ThunderDev1 commented 1 year ago

Did you manage to solve this @created-by-varun ? having the same problem

ThunderDev1 commented 1 year ago

Turned out I needed to rename my project for it to match the one declared in the dashboard 😄

Oakyden commented 1 year ago

@ThunderDev1 @created-by-varun I would love to know if you have apps currently running and working with iHealth? Having some real problems with it, they have since replied to me with an updated repository (they now use a completley different repository, this one - https://github.com/iHealthLab/iHealth-rn-sdk and have replaced what is hosted on node package manager https://www.npmjs.com/package/@ihealth/ihealthlibrary-react-native ) but I can't even start my app as soon as i NPM install the package! The guidance is really poor and there's no single piece of documentation on how to actually get up and running.

ThunderDev1 commented 1 year ago

The guidance is really poor and there's no single piece of documentation on how to actually get up and running.

That sums it up pretty well 😁

It's good to know they updated their repository (although it doesn't work 😓), I was starting to think they abandonned the project.

We eventually managed to get it working (with the old repo), we had to fork the project, based on this fork (many thanks to @wbroek) and updated the iOS and Android libraries with the latest ones you can download from their website. There may be other problems to resolve, can't quite remember, but it should put you on the right track.

Hope this helps, I can definitaly relate to the problems you are having 😄

razzfox commented 1 year ago

@ThunderDev1 could you please share your fork with the updated libraries and fixes?

Akiodesukedo commented 1 month ago

Turned out I needed to rename my project for it to match the one declared in the dashboard 😄

Thanks bro, You saved a beginner Native React programmer out of 2 weeks of struggle.