Authentication (CPIK Libraries)
CoPilot authentication is managed via Trimble Account Manager, a web-based platform used by fleets to assign CoPilot licenses to vehicles, devices, or drivers. To activate navigation features, configure your Account Manager credentials as shown below.
Account Manager Credentials
You’ll need your Account Manager unique Asset ID and Company ID to authenticate CoPilot on each device.
Java
// Set your Account Manager credentials
public static final String AMS_ASSET_ID = "YOUR_ASSET_ID";
public static final String AMS_COMPANY_ID = "YOUR_COMPANY_ID";
// License hook listener for authentication
private class LicenseHookListener extends LicenseListener {
@Override
public LicenseMgtInfo licenseMgtCredentialHook() {
return new LicenseMgtInfo(AMS_ASSET_ID, AMS_COMPANY_ID);
}
@Override
public void onLicenseMgtLogin(LicenseActivationResponse activationStatus, LicenseMgtInfo loginInfo) {
// Handle authentication response
if (activationStatus.isSuccess()) {
// Authentication successful
} else {
// Handle authentication failure. You can check activationStatus for the specific error.
// For example: if (activationStatus == LicenseActivationResponse.FAILED_LOGIN_INVALID_CREDS) { /* ... */ }
}
}
}
Objective-C
// Set your Account Manager credentials
static NSString * const AMS_ASSET_ID = @"YOUR_ASSET_ID";
static NSString * const AMS_COMPANY_ID = @"YOUR_COMPANY_ID";
// License hook listener for authentication
@interface LicenseHookListener : LicenseListener
@end
@implementation LicenseHookListener
- (LicenseMgtInfo *)licenseMgtCredentialHook {
return [[LicenseMgtInfo alloc] initWithAssetId:AMS_ASSET_ID companyId:AMS_COMPANY_ID];
}
- (void)onLicenseMgtLogin:(LicenseActivationResponse *)activationStatus loginInfo:(LicenseMgtInfo *)loginInfo {
// Handle authentication response
if ([activationStatus isSuccess]) {
// Authentication successful
} else {
// Handle authentication failure. You can check activationStatus for the specific error.
// For example: if (activationStatus == LicenseActivationResponseFailedLoginInvalidCreds) { /* ... */ }
}
}
@end