Skip to content

Instantly share code, notes, and snippets.

@skiph

skiph/Approov.swift

Created May 9, 2018
Embed
What would you like to do?
rndemo: swift bridging class
import Foundation
import Approov
@objc(Approov)
class Approov: NSObject {
@objc func fetchApproovToken(_ url: String,
resolver resolve: @escaping RCTPromiseResolveBlock,
rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
let attestee = ApproovAttestee.shared()
attestee?.fetchApproovToken({ (tokenFetchData: ApproovTokenFetchData) in
switch tokenFetchData.result {
case .successful:
resolve(tokenFetchData.approovToken)
case .failed:
resolve("NO_TOKEN")
}
}, url)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment