The RadarVerifiedLocationToken class represents a user’s verified location, including fraud detection results and a signed JWT token that can be verified server-side.
Verify the token server-side using your secret key for secure location verification.
Properties
The user associated with this verified location token.
An array of events associated with the verified location.
A signed JSON Web Token (JWT) containing the user and array of events. Verify the token server-side using your secret key.
The datetime when the token expires.
The number of seconds until the token expires.
A boolean indicating whether the user passed all jurisdiction and fraud detection checks.
An array of failure reasons for jurisdiction and fraud detection checks.
The Radar ID of the location check.
The full dictionary value of the token.
Methods
dictionaryValue
Returns a dictionary representation of the verified location token.
func dictionaryValue() -> [AnyHashable : Any]
- (NSDictionary *_Nonnull)dictionaryValue;
Returns: A dictionary containing all token properties.
Example
// Implement RadarVerifiedDelegate to receive tokens
func didUpdateToken(_ token: RadarVerifiedLocationToken) {
if token.passed {
// User passed all fraud checks
if let jwtToken = token.token {
// Send token to your server for verification
verifyTokenOnServer(jwtToken)
}
} else {
// User failed fraud checks
if let reasons = token.failureReasons {
print("Failed reasons: \(reasons)")
}
}
}
// Implement RadarVerifiedDelegate to receive tokens
- (void)didUpdateToken:(RadarVerifiedLocationToken *)token {
if (token.passed) {
// User passed all fraud checks
if (token.token) {
// Send token to your server for verification
[self verifyTokenOnServer:token.token];
}
} else {
// User failed fraud checks
if (token.failureReasons) {
NSLog(@"Failed reasons: %@", token.failureReasons);
}
}
}
See Also