Browse Source

added local authentication framework

pull/1/head
gme_2 6 years ago
parent
commit
4c3d26d5a0
  1. BIN
      .DS_Store
  2. 4
      GME Remit.xcodeproj/project.pbxproj
  3. 36
      GMERemittance/Module/Login/User Interface/View/LoginViewController.swift

BIN
.DS_Store

4
GME Remit.xcodeproj/project.pbxproj

@ -2027,6 +2027,7 @@
D97785A7215DC55F00754079 /* TransactionHistoryViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D977859C215DC55E00754079 /* TransactionHistoryViewInterface.swift */; }; D97785A7215DC55F00754079 /* TransactionHistoryViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D977859C215DC55E00754079 /* TransactionHistoryViewInterface.swift */; };
D97785AA215DD04400754079 /* TransactionHistoryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D97785A9215DD04400754079 /* TransactionHistoryTableViewCell.swift */; }; D97785AA215DD04400754079 /* TransactionHistoryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D97785A9215DD04400754079 /* TransactionHistoryTableViewCell.swift */; };
D97785AC215DD23400754079 /* TransactionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D97785AB215DD23400754079 /* TransactionModel.swift */; }; D97785AC215DD23400754079 /* TransactionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D97785AB215DD23400754079 /* TransactionModel.swift */; };
D99B6A4D22040E440096C1D6 /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D99B6A4C22040E440096C1D6 /* LocalAuthentication.framework */; };
D99D72AA212D595B00601F48 /* CountryInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D99D72A9212D595B00601F48 /* CountryInfo.swift */; }; D99D72AA212D595B00601F48 /* CountryInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D99D72A9212D595B00601F48 /* CountryInfo.swift */; };
D9AFE856215C7166005F3A25 /* HomeCollectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9AFE855215C7166005F3A25 /* HomeCollectionTableViewCell.swift */; }; D9AFE856215C7166005F3A25 /* HomeCollectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9AFE855215C7166005F3A25 /* HomeCollectionTableViewCell.swift */; };
D9B39677214F7DDC0072A9B8 /* ImageCroper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9B39675214F7DDC0072A9B8 /* ImageCroper.swift */; }; D9B39677214F7DDC0072A9B8 /* ImageCroper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9B39675214F7DDC0072A9B8 /* ImageCroper.swift */; };
@ -4167,6 +4168,7 @@
D977859C215DC55E00754079 /* TransactionHistoryViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionHistoryViewInterface.swift; sourceTree = "<group>"; }; D977859C215DC55E00754079 /* TransactionHistoryViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionHistoryViewInterface.swift; sourceTree = "<group>"; };
D97785A9215DD04400754079 /* TransactionHistoryTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionHistoryTableViewCell.swift; sourceTree = "<group>"; }; D97785A9215DD04400754079 /* TransactionHistoryTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionHistoryTableViewCell.swift; sourceTree = "<group>"; };
D97785AB215DD23400754079 /* TransactionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionModel.swift; sourceTree = "<group>"; }; D97785AB215DD23400754079 /* TransactionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionModel.swift; sourceTree = "<group>"; };
D99B6A4C22040E440096C1D6 /* LocalAuthentication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LocalAuthentication.framework; path = System/Library/Frameworks/LocalAuthentication.framework; sourceTree = SDKROOT; };
D99D72A9212D595B00601F48 /* CountryInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryInfo.swift; sourceTree = "<group>"; }; D99D72A9212D595B00601F48 /* CountryInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryInfo.swift; sourceTree = "<group>"; };
D9AFE855215C7166005F3A25 /* HomeCollectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCollectionTableViewCell.swift; sourceTree = "<group>"; }; D9AFE855215C7166005F3A25 /* HomeCollectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCollectionTableViewCell.swift; sourceTree = "<group>"; };
D9B39675214F7DDC0072A9B8 /* ImageCroper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCroper.swift; sourceTree = "<group>"; }; D9B39675214F7DDC0072A9B8 /* ImageCroper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCroper.swift; sourceTree = "<group>"; };
@ -4252,6 +4254,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
D99B6A4D22040E440096C1D6 /* LocalAuthentication.framework in Frameworks */,
D93C201722000D450079BF03 /* libMTransKey_Ar_v4.6.46.a in Frameworks */, D93C201722000D450079BF03 /* libMTransKey_Ar_v4.6.46.a in Frameworks */,
D93C201822000D450079BF03 /* RSLicenseSDK.framework in Frameworks */, D93C201822000D450079BF03 /* RSLicenseSDK.framework in Frameworks */,
6A8AD8BB36D4B4DB2E26485D /* Pods_GME_Remit.framework in Frameworks */, 6A8AD8BB36D4B4DB2E26485D /* Pods_GME_Remit.framework in Frameworks */,
@ -4772,6 +4775,7 @@
3DE940CE478E7407EB7DE7CE /* Frameworks */ = { 3DE940CE478E7407EB7DE7CE /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D99B6A4C22040E440096C1D6 /* LocalAuthentication.framework */,
FFD19C7B2112E8F20073689F /* Pods_GMERemittance.framework */, FFD19C7B2112E8F20073689F /* Pods_GMERemittance.framework */,
3DBF8A8DA8757D02AD2C382B /* Pods_GMERemittance.framework */, 3DBF8A8DA8757D02AD2C382B /* Pods_GMERemittance.framework */,
0380AEB198AADC0BC4394515 /* Pods_GMERemittanceTests.framework */, 0380AEB198AADC0BC4394515 /* Pods_GMERemittanceTests.framework */,

36
GMERemittance/Module/Login/User Interface/View/LoginViewController.swift

@ -8,6 +8,7 @@
import UIKit import UIKit
import Localize_Swift import Localize_Swift
import LocalAuthentication
class LoginViewController: UIViewController { class LoginViewController: UIViewController {
struct StringConstants { struct StringConstants {
@ -124,6 +125,38 @@ class LoginViewController: UIViewController {
// showAnimation() // showAnimation()
} }
func authenticateUser() {
let context : LAContext = LAContext()
var error: NSError?
let reasonString = "Authentication is needed to access Gme Remit application."
if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) {
context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: reasonString) { (success, error) in
if success {
print("authenticated")
}
else {
// print(evalPolicyError?.localizedDescription)
guard let error = error as NSError? else {return}
switch error.code {
case LAError.systemCancel.rawValue:
print("Authentication was cancell by the system")
case LAError.userCancel.rawValue:
print("Authentication cancelled by the user")
case LAError.userFallback.rawValue:
print("user selected to enter custome password")
default:
print("Authentication failed.")
}
}
}
}
}
func setupKeyboard() { func setupKeyboard() {
isShowNumber = false isShowNumber = false
isShowQwerty = true isShowQwerty = true
@ -211,9 +244,6 @@ class LoginViewController: UIViewController {
self.forgotPasswordView.alpha = 1 self.forgotPasswordView.alpha = 1
}) })
// header title // header title
// logoimageview // logoimageview

Loading…
Cancel
Save