Skip to content

Commit

Permalink
clear local storage before calling api login if was login but not cal…
Browse files Browse the repository at this point in the history
…l api logout
  • Loading branch information
Arief Nur Putranto committed Jul 25, 2023
1 parent 4c1fa2b commit 566c91d
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 96 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "qiscus/QiscusRealtime-iOS" "carthage-support"
github "qiscus/QiscusRealtime-iOS" "carthage-support-xcode14"
github "SwiftyJSON/SwiftyJSON" ~> 5.0
12 changes: 5 additions & 7 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github "SwiftyJSON/SwiftyJSON" "5.0.0"
github "amsibsam/CocoaMQTT" "b0b5519684789a037dea7397d857acd76e1e5b83"
github "daltoniam/Starscream" "3.0.2"
github "daltoniam/common-crypto-spm" "1.1.0"
github "daltoniam/zlib-spm" "1.1.0"
github "qiscus/QiscusRealtime-iOS" "b7df53fca5d7247d8ed2e15ccc0fb6182754b68d"
github "robbiehanson/CocoaAsyncSocket" "7.6.3"
github "SwiftyJSON/SwiftyJSON" "5.0.1"
github "daltoniam/Starscream" "3.1.1"
github "emqx/CocoaMQTT" "dec874c56de97f3f44410e803913882f66b0ef9f"
github "leeway1208/MqttCocoaAsyncSocket" "1.0.8"
github "qiscus/QiscusRealtime-iOS" "a018d1aa8c08f22ae8952fc1d616851ef9cc157f"
2 changes: 1 addition & 1 deletion Examples/carthage/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "qiscus/QiscusCore-iOS" "carthage-support"
github "qiscus/QiscusCore-iOS" "master"
8 changes: 4 additions & 4 deletions Examples/carthage/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github "SwiftyJSON/SwiftyJSON" "5.0.0"
github "amsibsam/CocoaMQTT" "b0b5519684789a037dea7397d857acd76e1e5b83"
github "SwiftyJSON/SwiftyJSON" "5.0.1"
github "amsibsam/CocoaMQTT" "4e48e7d2b707b645c2674bb45948b8b251b437c7"
github "daltoniam/Starscream" "3.0.2"
github "daltoniam/common-crypto-spm" "1.1.0"
github "daltoniam/zlib-spm" "1.1.0"
github "qiscus/QiscusCore-iOS" "870b0bf80360ee48666d5d4c4491da363164c541"
github "qiscus/QiscusRealtime-iOS" "9c1d754302d1ff2d16314247e85ee1520ab5baf4"
github "qiscus/QiscusCore-iOS" "4c1fa2bf6237fd61674859b7bf416c7a3723b24f"
github "qiscus/QiscusRealtime-iOS" "cfe75d8e6989e8e640b4072a0563d2252dc71683"
github "robbiehanson/CocoaAsyncSocket" "7.6.3"
2 changes: 1 addition & 1 deletion QiscusCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "QiscusCore"
s.version = "1.10.1"
s.version = "1.10.2"
s.summary = "Qiscus Core SDK for iOS"
s.description = <<-DESC
Qiscus SDK for iOS contains Qiscus public Model.
Expand Down
144 changes: 64 additions & 80 deletions QiscusCore.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
dependencies: [
.package(url: "https://github.com/qiscus/QiscusCore-iOS.git", from: "1.10.1"),
.package(url: "https://github.com/qiscus/QiscusCore-iOS.git", from: "1.10.2"),
]
)
```
Expand Down
22 changes: 21 additions & 1 deletion Source/QiscusCore/QiscusCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

public class QiscusCore: NSObject {
public static let qiscusCoreVersionNumber:String = "1.10.1"
public static let qiscusCoreVersionNumber:String = "1.10.2"
class var bundle:Bundle{
get{
let podBundle = Bundle(for: QiscusCore.self)
Expand Down Expand Up @@ -410,6 +410,11 @@ public class QiscusCore: NSObject {
if config.appID == nil {
fatalError("You need to set App ID")
}

if QiscusCore.hasSetupUser(){
QiscusCore.shared.stopQiscusCore()
}

network.getNonce(onSuccess: onSuccess, onError: onError)
}

Expand All @@ -422,6 +427,11 @@ public class QiscusCore: NSObject {
if config.appID == nil {
fatalError("You need to set App ID")
}

if QiscusCore.hasSetupUser(){
QiscusCore.shared.stopQiscusCore()
}

network.getNonce(onSuccess: onSuccess, onError: onError)
}

Expand All @@ -435,6 +445,11 @@ public class QiscusCore: NSObject {
if config.appID == nil {
fatalError("You need to set App ID")
}

if QiscusCore.hasSetupUser(){
QiscusCore.shared.stopQiscusCore()
}

network.login(email: userID, password: userKey, username: username, avatarUrl: avatarURL?.absoluteString, extras: extras, onSuccess: { (user) in
// save user in local
ConfigManager.shared.user = user
Expand All @@ -454,6 +469,11 @@ public class QiscusCore: NSObject {
if config.appID == nil {
fatalError("You need to set App ID")
}

if QiscusCore.hasSetupUser(){
QiscusCore.shared.stopQiscusCore()
}

network.login(email: userId, password: userKey, username: username, avatarUrl: avatarURL?.absoluteString, extras: extras, onSuccess: { (user) in
// save user in local
ConfigManager.shared.user = user
Expand Down

0 comments on commit 566c91d

Please sign in to comment.