Search code examples
iosobjective-cxcode9hypertrack

hypertrack - always show Device disconnected on dashboard objective c iOS


i am creating action "visit" after new user create in objective c iOS but on dashboard device disconnected show against user nor can see location through url or action id. here is screen short.

    -(void)createUser{
    [HyperTrack initialize:@"......."];
    [HyperTrack requestAlwaysAuthorizationWithCompletionHandler:^(BOOL authorized) {
        //handle authorization status, if needed
    }];
    [HyperTrack requestMotionAuthorization];
    [HyperTrack getOrCreateUser:@"test1" _phone:@"12345" :@"12" completionHandler:^(HyperTrackUser * _Nullable user, HyperTrackError * _Nullable error) {
        if (user) {
            // Handle getOrCreateUser API success here
            NSLog(@"User Created");
            NSLog(@"%@",user.id);
            [self createAction:user.id];

        } else {
            // Handle createUser error here, if required
            NSLog(@"User Created error %@",error);

        }
    }];
}

-(void)createAction:(NSString *)userId{
    HyperTrackActionParams* actionParams = [[HyperTrackActionParams alloc] init];
    [actionParams setType:@"visit"];
    [actionParams setUserId:userId];
    [HyperTrack createAndAssignAction:actionParams :^(HyperTrackAction * action, HyperTrackError * error) {
        if (error) {
            // Handle createAction API error here
            return;
        }
        if (action) {
            // Handle createAction API success here
            NSLog(@"%@",action.id);
            NSLog(@"%@",action.trackingUrl);
        }
    }];
}

Solution

  • My pod was outdated. I reinstalled pod with pod 'HyperTrack', '~> 0.7'. Now its working fine.