Skip to content

Commit 351cbaa

Browse files
committed
change startSDK to start
1 parent 0916872 commit 351cbaa

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

DemoObjCApp/AppDelegate.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
5656
-(void)initializeOptimizelySDKAsynchronous {
5757
self.optimizely = [[OptimizelyManager alloc] initWithSdkKey:kOptimizelySdkKey];
5858

59-
[self.optimizely startSDKWithCompletion:^(NSData *data, NSError *error) {
59+
[self.optimizely startWithCompletion:^(NSData *data, NSError *error) {
6060
if (error == nil) {
6161
NSLog(@"Optimizely SDK initialized successfully!");
6262
} else {
@@ -85,7 +85,7 @@ -(void)initializeOptimizelySDKSynchronous {
8585
self.optimizely = nil;
8686
} else {
8787
NSError *error;
88-
BOOL status = [self.optimizely startSDKWithDatafile:datafileJSON error:&error];
88+
BOOL status = [self.optimizely startWithDatafile:datafileJSON error:&error];
8989
if (status) {
9090
NSLog(@"Optimizely SDK initialized successfully!");
9191
} else {
@@ -136,7 +136,7 @@ -(void)initializeOptimizelySDKWithCustomization {
136136
#endif
137137
}];
138138

139-
[self.optimizely startSDKWithCompletion:^(NSData *data, NSError *error) {
139+
[self.optimizely startWithCompletion:^(NSData *data, NSError *error) {
140140
if (error == nil) {
141141
NSLog(@"Optimizely SDK initialized successfully!");
142142
} else {

DemoSwiftApp/AppDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
6363
func initializeOptimizelySDKAsynchronous() {
6464
optimizely = OptimizelyManager(sdkKey: sdkKey)
6565

66-
optimizely.startSDK { result in
66+
optimizely.start { result in
6767
switch result {
6868
case .failure(let error):
6969
print("Optimizely SDK initiliazation failed: \(error)")
@@ -87,7 +87,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8787

8888
do {
8989
let datafileJSON = try String(contentsOfFile: localDatafilePath, encoding: .utf8)
90-
try optimizely!.startSDK(datafile: datafileJSON)
90+
try optimizely!.start(datafile: datafileJSON)
9191
print("Optimizely SDK initialized successfully!")
9292
} catch {
9393
print("Optimizely SDK initiliazation failed: \(error)")
@@ -154,7 +154,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
154154

155155
// initialize SDK
156156

157-
optimizely!.startSDK { result in
157+
optimizely!.start { result in
158158
switch result {
159159
case .failure(let error):
160160
print("Optimizely SDK initiliazation failed: \(error)")

OptimizelySDK/Optimizely/OptimizelyManager+ObjC.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ extension OptimizelyManager {
5050
}
5151

5252
@available(swift, obsoleted: 1.0)
53-
@objc(startSDKWithCompletion:)
53+
@objc(startWithCompletion:)
5454
/// Start Optimizely SDK (Asynchronous)
5555
///
5656
/// If an updated datafile is available in the server, it's downloaded and the SDK is configured with
5757
/// the updated datafile.
5858
///
5959
/// - Parameters:
6060
/// - completion: callback when initialization is completed
61-
public func _objcStartSDK(completion: ((Data?, NSError?) -> Void)?) {
62-
startSDK { result in
61+
public func _objcStart(completion: ((Data?, NSError?) -> Void)?) {
62+
start { result in
6363
switch result {
6464
case .failure(let error):
6565
completion?(nil, self.convertErrorForObjc(error))
@@ -70,19 +70,19 @@ extension OptimizelyManager {
7070
}
7171

7272
@available(swift, obsoleted: 1.0)
73-
@objc(startSDKWithDatafile:error:)
73+
@objc(startWithDatafile:error:)
7474
/// Start Optimizely SDK (Synchronous)
7575
///
7676
/// - Parameters:
7777
/// - datafile: This datafile will be used when cached copy is not available (fresh start).
7878
/// A cached copy from previous download is used if it's available.
7979
/// The datafile will be updated from the server in the background thread.
80-
public func _objcStartSDKWith(datafile:String) throws {
81-
try self.startSDK(datafile: datafile)
80+
public func _objcStartWith(datafile:String) throws {
81+
try self.start(datafile: datafile)
8282
}
8383

8484
@available(swift, obsoleted: 1.0)
85-
@objc(startSDKWithDatafile:doFetchDatafileBackground:error:)
85+
@objc(startWithDatafile:doFetchDatafileBackground:error:)
8686
/// Start Optimizely SDK (Synchronous)
8787
///
8888
/// - Parameters:
@@ -92,8 +92,8 @@ extension OptimizelyManager {
9292
/// - doFetchDatafileBackground: This is for debugging purposes when
9393
/// you don't want to download the datafile. In practice, you should allow the
9494
/// background thread to update the cache copy (optional)
95-
public func _objcStartSDK(datafile: Data, doFetchDatafileBackground: Bool = true) throws {
96-
try self.startSDK(datafile: datafile, doFetchDatafileBackground: doFetchDatafileBackground)
95+
public func _objcStart(datafile: Data, doFetchDatafileBackground: Bool = true) throws {
96+
try self.start(datafile: datafile, doFetchDatafileBackground: doFetchDatafileBackground)
9797
}
9898

9999
@available(swift, obsoleted: 1.0)

OptimizelySDK/Optimizely/OptimizelyManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ open class OptimizelyManager: NSObject {
9090
/// - Parameters:
9191
/// - resourceTimeout: timeout for datafile download (optional)
9292
/// - completion: callback when initialization is completed
93-
public func startSDK(resourceTimeout:Double? = nil, completion: ((OptimizelyResult<Data>) -> Void)?=nil) {
93+
public func start(resourceTimeout:Double? = nil, completion: ((OptimizelyResult<Data>) -> Void)?=nil) {
9494
fetchDatafileBackground(resourceTimeout:resourceTimeout) { result in
9595
switch result {
9696
case .failure:
@@ -116,12 +116,12 @@ open class OptimizelyManager: NSObject {
116116
/// - datafile: This datafile will be used when cached copy is not available (fresh start).
117117
/// A cached copy from previous download is used if it's available.
118118
/// The datafile will be updated from the server in the background thread.
119-
public func startSDK(datafile: String) throws {
119+
public func start(datafile: String) throws {
120120
guard let datafileData = datafile.data(using: .utf8) else {
121121
throw OptimizelyError.dataFileInvalid
122122
}
123123

124-
try startSDK(datafile: datafileData)
124+
try start(datafile: datafileData)
125125
}
126126

127127
/// Start Optimizely SDK (Synchronous)
@@ -133,7 +133,7 @@ open class OptimizelyManager: NSObject {
133133
/// - doFetchDatafileBackground: This is for debugging purposes when
134134
/// you don't want to download the datafile. In practice, you should allow the
135135
/// background thread to update the cache copy (optional)
136-
public func startSDK(datafile: Data, doFetchDatafileBackground: Bool = true) throws {
136+
public func start(datafile: Data, doFetchDatafileBackground: Bool = true) throws {
137137
let cachedDatafile = self.datafileHandler.loadSavedDatafile(sdkKey: self.sdkKey)
138138

139139
let selectedDatafile = cachedDatafile ?? datafile

0 commit comments

Comments
 (0)