Skip to content

Commit 047b03a

Browse files
authored
Merge pull request #86 from sendbird/release/1.4.1
Release 1.4.1
2 parents e7ca663 + 84c3117 commit 047b03a

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

QuickStart.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@
892892
"$(inherited)",
893893
"@executable_path/Frameworks",
894894
);
895-
MARKETING_VERSION = 1.4.0;
895+
MARKETING_VERSION = 1.4.1;
896896
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.calls.quickstart;
897897
PRODUCT_NAME = "Sendbird Calls";
898898
SWIFT_VERSION = 5.0;
@@ -922,7 +922,7 @@
922922
"$(inherited)",
923923
"@executable_path/Frameworks",
924924
);
925-
MARKETING_VERSION = 1.4.0;
925+
MARKETING_VERSION = 1.4.1;
926926
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.calls.quickstart;
927927
PRODUCT_NAME = "Sendbird Calls";
928928
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -944,7 +944,7 @@
944944
"@executable_path/Frameworks",
945945
"@executable_path/../../Frameworks",
946946
);
947-
MARKETING_VERSION = 1.4.0;
947+
MARKETING_VERSION = 1.4.1;
948948
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.calls.quickstart.QuickStartIntent;
949949
PRODUCT_NAME = "$(TARGET_NAME)";
950950
SKIP_INSTALL = YES;
@@ -967,7 +967,7 @@
967967
"@executable_path/Frameworks",
968968
"@executable_path/../../Frameworks",
969969
);
970-
MARKETING_VERSION = 1.4.0;
970+
MARKETING_VERSION = 1.4.1;
971971
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.calls.quickstart.QuickStartIntent;
972972
PRODUCT_NAME = "$(TARGET_NAME)";
973973
SKIP_INSTALL = YES;

QuickStart/AppDelegate.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2626
// MARK: SendBirdCall.configure(appId:)
2727
// See [here](https://github.com/sendbird/quickstart-calls-ios#creating-a-sendbird-application) for the application ID.
2828
// If you want to sign in with QR code, don't configure your app ID in code.
29-
// SendBirdCall.configure(appId: YOUR_APP_ID)
29+
30+
// Configure your app id here to designate a specific app id for the application.
31+
// let appId = YOUR_APP_ID
32+
// SendBirdCall.configure(appId: appId)
33+
// UserDefaults.standard.designatedAppId = appId
3034

3135
self.autoSignIn { error in
3236
if error == nil { return }
@@ -81,8 +85,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8185
}
8286

8387
func authenticate(with credential: Credential, completionHandler: @escaping (Error?) -> Void) {
84-
// Configure app ID before authenticate when there is no configured app ID
85-
if SendBirdCall.appId == nil { SendBirdCall.configure(appId: credential.appId) }
88+
// Configure app ID before authenticate when the configured app ID is different.
89+
if SendBirdCall.appId != credential.appId, UserDefaults.standard.designatedAppId == nil {
90+
SendBirdCall.configure(appId: credential.appId)
91+
}
8692

8793
// Authenticate
8894
let authParams = AuthenticateParams(userId: credential.userId, accessToken: credential.accessToken)

QuickStart/Extensions/UIKit/UIStoryboard+QuickStart.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ extension UIStoryboard {
3737

3838
extension UIStoryboard {
3939
static func signController() -> UIViewController {
40-
let controller = (SendBirdCall.appId != nil ? QuickStart.simpleSignIn : QuickStart.signIn).controller
40+
let hasConfiguredAppId = (UserDefaults.standard.credential?.appId != nil || UserDefaults.standard.designatedAppId != nil)
41+
let controller = (hasConfiguredAppId ? QuickStart.simpleSignIn : QuickStart.signIn).controller
4142
if #available(iOS 13.0, *) {
4243
controller.isModalInPresentation = true
4344
}

QuickStart/Extensions/UserDefaults+QuickStart.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extension UserDefaults {
1212
case credential
1313
case voipPushToken
1414
case callHistories
15+
case designatedAppId
1516

1617
var value: String { "com.sendbird.calls.quickstart.\(self.rawValue.lowercased())" }
1718
}
@@ -35,12 +36,17 @@ extension UserDefaults {
3536
get { UserDefaults.standard.get(objectType: [CallHistory].self, forKey: Key.callHistories.value) ?? [] }
3637
set { UserDefaults.standard.set(object: newValue, forKey: Key.callHistories.value) }
3738
}
39+
40+
var designatedAppId: String? {
41+
get { UserDefaults.standard.value(forKey: Key.designatedAppId.value) as? String }
42+
set { UserDefaults.standard.setValue(newValue, forKey: Key.designatedAppId.value) }
43+
}
3844
}
3945

4046
extension UserDefaults {
4147
func clear() {
4248
Key.allCases
43-
.filter { $0 != .voipPushToken }
49+
.filter { $0 != .voipPushToken && $0 != .designatedAppId }
4450
.map { $0.value }
4551
.forEach(UserDefaults.standard.removeObject)
4652
}

0 commit comments

Comments
 (0)