|
@@ -86,25 +86,28 @@ public class ChangeDeviceViewController: UIViewController {
|
|
|
if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSendOTPLogin(p_email: email), timeout: 30 * 1000) {
|
|
|
if response.getBody(key: CoreMessage_TMessageKey.ERRCOD, default_value: "99") != "00" {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unregistered email account".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Unregistered email account".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- self.showPageOTP(email: email)
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ self.showPageOTP(email: email)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -120,8 +123,9 @@ public class ChangeDeviceViewController: UIViewController {
|
|
|
if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSendVerifyChangeDevice(p_email: email, p_vercode: code), timeout: 30 * 1000) {
|
|
|
if !response.isOk() {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- self.showPageOTP(email: email, errCode: response.getBody(key: CoreMessage_TMessageKey.ERRCOD, default_value: "99"))
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ self.showPageOTP(email: email, errCode: response.getBody(key: CoreMessage_TMessageKey.ERRCOD, default_value: "99"))
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
self.deleteAllRecordDatabase()
|
|
@@ -135,34 +139,36 @@ public class ChangeDeviceViewController: UIViewController {
|
|
|
// pos registration
|
|
|
_ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: id))
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed device".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
- if self.fromChangeNamePass{
|
|
|
- var vc = self.navigationController?.presentingViewController
|
|
|
- while vc?.presentingViewController != nil {
|
|
|
- vc = vc?.presentingViewController
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Successfully changed device".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ if self.fromChangeNamePass{
|
|
|
+ var vc = self.navigationController?.presentingViewController
|
|
|
+ while vc?.presentingViewController != nil {
|
|
|
+ vc = vc?.presentingViewController
|
|
|
+ }
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
}
|
|
|
- vc?.dismiss(animated: true, completion: nil)
|
|
|
- }
|
|
|
- else if !self.forceLogin {
|
|
|
- self.navigationController?.popViewController(animated: true)
|
|
|
- } else {
|
|
|
- self.navigationController?.dismiss(animated: true)
|
|
|
- }
|
|
|
- self.isDismiss?(thumb)
|
|
|
+ else if !self.forceLogin {
|
|
|
+ self.navigationController?.popViewController(animated: true)
|
|
|
+ } else {
|
|
|
+ self.navigationController?.dismiss(animated: true)
|
|
|
+ }
|
|
|
+ self.isDismiss?(thumb)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -218,19 +224,21 @@ public class ChangeDeviceViewController: UIViewController {
|
|
|
if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSignIn(p_name: name, p_password: md5Hex), timeout: 30 * 1000) {
|
|
|
if response.getBody(key: CoreMessage_TMessageKey.ERRCOD, default_value: "99") == "11" {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Invalid user / Username and password does not match".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Invalid user / Username and password does not match".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
} else if !response.isOk() {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
self.deleteAllRecordDatabase()
|
|
@@ -244,34 +252,36 @@ public class ChangeDeviceViewController: UIViewController {
|
|
|
// pos registration
|
|
|
_ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: id))
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed device".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
- if self.fromChangeNamePass{
|
|
|
- var vc = self.navigationController?.presentingViewController
|
|
|
- while vc?.presentingViewController != nil {
|
|
|
- vc = vc?.presentingViewController
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Successfully changed device".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ if self.fromChangeNamePass{
|
|
|
+ var vc = self.navigationController?.presentingViewController
|
|
|
+ while vc?.presentingViewController != nil {
|
|
|
+ vc = vc?.presentingViewController
|
|
|
+ }
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
+ }
|
|
|
+ else if !self.forceLogin {
|
|
|
+ self.navigationController?.popViewController(animated: true)
|
|
|
+ } else {
|
|
|
+ self.navigationController?.dismiss(animated: true)
|
|
|
}
|
|
|
- vc?.dismiss(animated: true, completion: nil)
|
|
|
- }
|
|
|
- else if !self.forceLogin {
|
|
|
- self.navigationController?.popViewController(animated: true)
|
|
|
- } else {
|
|
|
- self.navigationController?.dismiss(animated: true)
|
|
|
- }
|
|
|
- self.isDismiss?(thumb)
|
|
|
+ self.isDismiss?(thumb)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader()
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
- imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ Nexilis.hideLoader(completion: {
|
|
|
+ let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
+ imageView.tintColor = .white
|
|
|
+ let banner = FloatingNotificationBanner(title: "Unable to access servers. Try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ banner.show()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|