How to integrate the fraud prevention profiler on iOS.
nethonesdk-ios-{your_company_name}-spm
repository.nethonesdk-ios-{your_company_name}
repository.nethonesdk-ios-{your_company_name}
repository.setMerchantNumber(...)
shortly after application starts.
For example in didFinishLaunchingWithOptions
:
attemptReference
is a unique, single-use identifier used to identify a specific profiling attempt. Your server will use this reference to query Nethone about the status of the attempt.
AttemptReference
is generated by calling the beginAttempt
function and is accessible by a static function named attemptReference
.
NTHNethone.beginAttempt
method.
The behavioral data collection can also be turned off by setting the configuration variable config.withoutBehavioralData
to true
(swift) or YES
(objective-c), and passing this configuration when starting the attempt.
finalizeButtonTapped
function makes sure that the necessary data has reached us. It is not recommended to terminate profiling and continue the flow until the function returns to the completion block.
sendCustomAttemptData
method and add the options
argument to specify the type of the custom data.
The available option is DataTypeJson
.
sendCustomAttemptData
on a not started or already completed attempt, or passing a data type that does not match the one provided in the options
argument will return an error.Error code | Error message | Short description |
---|---|---|
kNTHApiErrorMerchantNumberNotSet = -1 | Begin calls while the merchant number is not set. | Without setting the merchant number, profiling cannot be started and no data will be collected. |
kNTHApiErrorAnotherAttemptOngoing = -2 | Begin called when another attempt is ongoing. | It is possible that the previous profiling has not yet completed finalization (after calling the +finalizeAttemptWithCompletion:error: ). In this case, you should wait for it to finish before starting the next profiling. To force the immediate termination of the profiling, you can call +cancelAttemptWithError: . However, this may result in the collection of insufficient data. |
kNTHApiErrorFinalizingAlreadyEndedAttempt = -5 | Finalize or send custom data called when the attempt is already completed or canceled. | The last profiling has already been completed. Currently, no profiling is in progress and it is not possible to finalize it or send additional data as part of it. The AttemptReference of the last profiling can be found in error.userInfo under the key kNTHNethoneAttemptReference . |
kNTHApiErrorCancelingAlreadyEndedAttempt = -15 | Cancel called when the attempt is already completed or canceled. | The last profiling has already been completed. Currently, no profiling is in progress and it is not possible to cancel it. |
kNTHApiErrorAttemptDuringFinalization = -13 | Finalize or send custom data called when profiling has already been finalized. | Custom data cannot be sent during finalization or after profiling is completed. |
kNTHApiErrorAttemptNotInitiated = -6 | Finalize, cancel or send custom data called without begin called before. | Currently, no profiling has been started. It is not possible to finalize, cancel, or send additional data. |
kNTHApiErrorInvalidCustomData = -14 | Send custom data called with structure that cannot be parsed properly. |
registerTextField()
method will register a text field to send data from it.
The function takes a mode
parameter which indicates the mode in which textField
will collect data. The NTHRegisterMode
enum provides constants for the data collecting options for a textField
when registered.
There are 3 possible options:
name
parameter which describes the given textField
in collected data. When left as Null
, the value will be determined automatically, however it might be inaccurate.
The text fields are permanently registered, which means that data from these fields will be collected during each profiling. There is no need to register fields every time during the start of an attempt.
textFields
.
NSLocale.regionCode
function.
Apple detects the use of CallKit during the Apple Review process and makes sure the developer is aware of the regulation by rejecting the application with a message. You need to reply that your CallKit implementation is not active in China, and include a short message in the Reviewer Information section saying: “In this version and next we do not use CallKit for users in China. We detect the user’s region with NSLocale
”.