在目标C iOS中创建新用户后,我正在创建操作“访问”,但在仪表板设备上,断开与用户的连接,无法通过URL或操作ID查看位置。以下是屏幕简短信息。
-(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);
}
}];
}