The DeviceDNA iOS library allows you to identify devices using the Judopay Genome service
CocoaPods is a dependency manager for Cocoa projects.
$ gem install cocoapods
Podfile
to integrate it into your Xcode project:source 'https://github.com/CocoaPods/Specs.git'
pod 'DeviceDNA', '~> 2.0'
$ pod install
.xcworkspace
file not not the projects .xcodeproj
fileswift
@import DeviceDNA
obj-c
#import <DeviceDNA/DeviceDNA.h>
swift
let credentials = Credentials(<YOUR_TOKEN> secret:<YOUR_SECRET>)
let deviceDNA = DeviceDNA(credentials: credentials)
obj-c
Credentials *credentials = [[Credentials alloc] initWithToken:<YOUR_TOKEN> secret:<YOUR_SECRET>];
DeviceDNA *deviceDNA = [[DeviceDNA alloc] initWithCredentials:credentials];
swift
deviceDNA.identifyDevice { (deviceIdentifier, error) in
//Your provided callback.
}
obj-c
[deviceDNA identifyDevice:^(NSString * _Nullable deviceIdentifier, NSError * _Nullable error) {
//Your provided callback.
}];
swift
deviceDNA.getDeviceProfile(deviceId) { (device, error) in
//Your provided callback.
}
obj-c
[deviceDNA getDeviceProfile:deviceId completion:^(NSDictionary<NSString *,id> * _Nullable device, NSError * _Nullable error) {
//Your provided callback.
}];
When performing server to server payments using the Judopay API, you may wish to identify the device at the time of payment. To obtain the device signals necessary for fraud prevention, use DeviceDNA to obtain the encrypted signals which will be passed in the clientDetails
JSON field of the request body:
swift
deviceDNA.getDeviceSignals { (device, error) in
if let device = device as [String : String]?
let deviceId = device["deviceIdentifier"];
let key = device["key"];
let value = device["value"];
}
}
obj-c
[deviceDNA getDeviceSignals:^(NSDictionary<NSString *,NSString *> * _Nullable device, NSError * _Nullable error) {
NSString *deviceId = device["deviceIdentifier"];
NSString *key = device["key"];
NSString *value = device["value"];
}];
link |
Stars: 5 |
Last commit: 1 year ago |
XCFramework support
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics