Commit b66b4fb8 by Dima Bart

Merge pull request #210 from Shopify/task/clean-up

Remove deprecations across the SDK
parents b8795034 0a69d7c5
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
- (void)setUp - (void)setUp
{ {
_modelManager = [BUYModelManager modelManager]; _modelManager = [BUYModelManager modelManager];
_checkout = [[BUYCheckout alloc] initWithCart:nil]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:nil];
} }
- (void)tearDown - (void)tearDown
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
- (void)testInitWithCartAddsLineItems - (void)testInitWithCartAddsLineItems
{ {
[_cart addVariant:_variant]; [_cart addVariant:_variant];
BUYCheckout *checkout = [[BUYCheckout alloc] initWithCart:_cart]; BUYCheckout *checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
XCTAssertEqual([[checkout lineItems] count], [[_cart lineItems] count]); XCTAssertEqual([[checkout lineItems] count], [[_cart lineItems] count]);
XCTAssertTrue([checkout isDirty]); XCTAssertTrue([checkout isDirty]);
} }
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
- (void)testHasToken - (void)testHasToken
{ {
BUYCheckout *checkout = [[BUYCheckout alloc] initWithCart:_cart]; BUYCheckout *checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
checkout.token = nil; checkout.token = nil;
XCTAssertFalse([checkout hasToken]); XCTAssertFalse([checkout hasToken]);
checkout.token = @""; checkout.token = @"";
......
...@@ -70,7 +70,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg"; ...@@ -70,7 +70,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
- (NSData *)dataForCartFromClient:(BUYClient *)client - (NSData *)dataForCartFromClient:(BUYClient *)client
{ {
BUYCart *cart = [self cart]; BUYCart *cart = [self cart];
BUYCheckout *checkout = [[BUYCheckout alloc] initWithCart:cart]; BUYCheckout *checkout = [[BUYCheckout alloc] initWithModelManager:cart.modelManager cart:cart];
BUYRequestOperation *task = (BUYRequestOperation *)[self.client createCheckout:checkout completion:^(BUYCheckout *checkout, NSError *error) {}]; BUYRequestOperation *task = (BUYRequestOperation *)[self.client createCheckout:checkout completion:^(BUYCheckout *checkout, NSError *error) {}];
XCTAssertNotNil(task); XCTAssertNotNil(task);
...@@ -99,7 +99,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg"; ...@@ -99,7 +99,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
- (void)testPartialAddressesFlag - (void)testPartialAddressesFlag
{ {
BUYCart *cart = [self cart]; BUYCart *cart = [self cart];
BUYCheckout *checkout = [[BUYCheckout alloc] initWithCart:cart]; BUYCheckout *checkout = [[BUYCheckout alloc] initWithModelManager:cart.modelManager cart:cart];
XCTAssertThrows([checkout setPartialAddressesValue:NO]); XCTAssertThrows([checkout setPartialAddressesValue:NO]);
...@@ -107,7 +107,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg"; ...@@ -107,7 +107,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:task.originalRequest.HTTPBody options:0 error:nil]; NSDictionary *json = [NSJSONSerialization JSONObjectWithData:task.originalRequest.HTTPBody options:0 error:nil];
XCTAssertFalse([json[@"checkout"][@"partial_addresses"] boolValue]); XCTAssertFalse([json[@"checkout"][@"partial_addresses"] boolValue]);
checkout = [[BUYCheckout alloc] initWithCart:cart]; checkout = [[BUYCheckout alloc] initWithModelManager:cart.modelManager cart:cart];
BUYAddress *partialAddress = [self.client.modelManager insertAddressWithJSONDictionary:nil]; BUYAddress *partialAddress = [self.client.modelManager insertAddressWithJSONDictionary:nil];
partialAddress.address1 = nil; partialAddress.address1 = nil;
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
{ {
[OHHTTPStubs stubUsingResponseWithKey:@"testCheckoutFlowUsingCreditCard_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testCheckoutFlowUsingCreditCard_1" useMocks:[self shouldUseMocks]];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
_checkout.shippingAddress = [self shippingAddress]; _checkout.shippingAddress = [self shippingAddress];
_checkout.billingAddress = [self billingAddress]; _checkout.billingAddress = [self billingAddress];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testCheckoutFlowUsingCreditCard_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testCheckoutFlowUsingCreditCard_1" useMocks:[self shouldUseMocks]];
[self createCart]; [self createCart];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
NSString *note = @"Order note"; NSString *note = @"Order note";
_checkout.note = note; _checkout.note = note;
...@@ -709,7 +709,7 @@ ...@@ -709,7 +709,7 @@
- (void)testCheckoutWithInvalidShop - (void)testCheckoutWithInvalidShop
{ {
[self createCart]; [self createCart];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[OHHTTPStubs stubUsingResponseWithKey:@"testInvalidIntegrationBadShopUrl_0" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testInvalidIntegrationBadShopUrl_0" useMocks:[self shouldUseMocks]];
...@@ -733,7 +733,7 @@ ...@@ -733,7 +733,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testFetchingShippingRatesWithoutShippingAddress_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testFetchingShippingRatesWithoutShippingAddress_1" useMocks:[self shouldUseMocks]];
[self createCart]; [self createCart];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client createCheckout:_checkout completion:^(BUYCheckout *returnedCheckout, NSError *error) { [self.client createCheckout:_checkout completion:^(BUYCheckout *returnedCheckout, NSError *error) {
...@@ -766,7 +766,7 @@ ...@@ -766,7 +766,7 @@
{ {
[OHHTTPStubs stubUsingResponseWithKey:@"testFetchingShippingRatesWithInvalidCheckout_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testFetchingShippingRatesWithInvalidCheckout_1" useMocks:[self shouldUseMocks]];
BUYCheckout *checkout = [[BUYCheckout alloc] initWithCart:nil]; BUYCheckout *checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:nil];
checkout.token = @"bananaaaa"; checkout.token = @"bananaaaa";
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
...@@ -792,7 +792,7 @@ ...@@ -792,7 +792,7 @@
- (void)testCheckoutWithAPartialAddress - (void)testCheckoutWithAPartialAddress
{ {
[self createCart]; [self createCart];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
_checkout.shippingAddress = [self partialShippingAddress]; _checkout.shippingAddress = [self partialShippingAddress];
if ([_checkout.shippingAddress isPartialAddress]) { if ([_checkout.shippingAddress isPartialAddress]) {
...@@ -836,7 +836,7 @@ ...@@ -836,7 +836,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithValidDiscount_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithValidDiscount_1" useMocks:[self shouldUseMocks]];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
_checkout.discount = [self applicableDiscount]; _checkout.discount = [self applicableDiscount];
// Create the checkout // Create the checkout
...@@ -865,7 +865,7 @@ ...@@ -865,7 +865,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithExpiredDiscount_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithExpiredDiscount_1" useMocks:[self shouldUseMocks]];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
_checkout.discount = [self inapplicableDiscount]; _checkout.discount = [self inapplicableDiscount];
//Create the checkout //Create the checkout
...@@ -887,7 +887,7 @@ ...@@ -887,7 +887,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithNonExistentDiscount_1" useMocks:[self shouldUseMocks]]; [OHHTTPStubs stubUsingResponseWithKey:@"testCreateCheckoutWithNonExistentDiscount_1" useMocks:[self shouldUseMocks]];
_checkout = [[BUYCheckout alloc] initWithCart:_cart]; _checkout = [[BUYCheckout alloc] initWithModelManager:_modelManager cart:_cart];
_checkout.discount = [self nonExistentDiscount]; _checkout.discount = [self nonExistentDiscount];
//Create the checkout //Create the checkout
......
...@@ -109,6 +109,9 @@ ...@@ -109,6 +109,9 @@
84D73C081CDD194D000F978A /* _BUYAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D73BFF1CDD1931000F978A /* _BUYAddress.m */; }; 84D73C081CDD194D000F978A /* _BUYAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D73BFF1CDD1931000F978A /* _BUYAddress.m */; };
84D73C091CDD194D000F978A /* BUYAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D73C011CDD1931000F978A /* BUYAddress.m */; }; 84D73C091CDD194D000F978A /* BUYAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D73C011CDD1931000F978A /* BUYAddress.m */; };
84D915441CC0359700D334FB /* BUYObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915411CC0359700D334FB /* BUYObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; 84D915441CC0359700D334FB /* BUYObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915411CC0359700D334FB /* BUYObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
84D915431CC0359700D334FB /* BUYObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915411CC0359700D334FB /* BUYObserver.h */; };
84D915441CC0359700D334FB /* BUYObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915411CC0359700D334FB /* BUYObserver.h */; };
84D915451CC0359700D334FB /* BUYObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D915421CC0359700D334FB /* BUYObserver.m */; };
84D915461CC0359700D334FB /* BUYObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D915421CC0359700D334FB /* BUYObserver.m */; }; 84D915461CC0359700D334FB /* BUYObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D915421CC0359700D334FB /* BUYObserver.m */; };
84D9154C1CC03F1600D334FB /* BUYManagedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915471CC03F1600D334FB /* BUYManagedObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; 84D9154C1CC03F1600D334FB /* BUYManagedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D915471CC03F1600D334FB /* BUYManagedObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
84D9154E1CC03F1600D334FB /* BUYManagedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D915481CC03F1600D334FB /* BUYManagedObject.m */; }; 84D9154E1CC03F1600D334FB /* BUYManagedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D915481CC03F1600D334FB /* BUYManagedObject.m */; };
...@@ -1422,7 +1425,7 @@ ...@@ -1422,7 +1425,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1.2.6; CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
...@@ -1454,7 +1457,7 @@ ...@@ -1454,7 +1457,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.2.6; CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
...@@ -1662,13 +1665,45 @@ ...@@ -1662,13 +1665,45 @@
}; };
name = "Debug-core-data"; name = "Debug-core-data";
}; };
B2AE98381CED035700FB0C5D /* Debug-core-data */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "$(SRCROOT)/Mobile Buy SDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "${PROJECT_DIR}/Mobile Buy SDK/Static Framework/Buy.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = "com.shopify.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Buy;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = "Debug-core-data";
};
B2AE98391CED035700FB0C5D /* Debug-core-data */ = { B2AE98391CED035700FB0C5D /* Debug-core-data */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1.2.6; CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
...@@ -1779,6 +1814,35 @@ ...@@ -1779,6 +1814,35 @@
}; };
name = "Release-core-data"; name = "Release-core-data";
}; };
B2AE98441CED036F00FB0C5D /* Release-core-data */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Mobile Buy SDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "${PROJECT_DIR}/Mobile Buy SDK/Static Framework/Buy.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = "com.shopify.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Buy;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = "Release-core-data";
};
B2AE98451CED036F00FB0C5D /* Release-core-data */ = { B2AE98451CED036F00FB0C5D /* Release-core-data */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
...@@ -1786,7 +1850,7 @@ ...@@ -1786,7 +1850,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.2.6; CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
...@@ -1808,6 +1872,65 @@ ...@@ -1808,6 +1872,65 @@
}; };
name = "Release-core-data"; name = "Release-core-data";
}; };
BE9A64421B503C2F0033E558 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "$(SRCROOT)/Mobile Buy SDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "${PROJECT_DIR}/Mobile Buy SDK/Static Framework/Buy.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = "com.shopify.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Buy;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
BE9A64431B503C2F0033E558 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Mobile Buy SDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "${PROJECT_DIR}/Mobile Buy SDK/Static Framework/Buy.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = "com.shopify.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Buy;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
F773742C19C770CB0039681C /* Debug */ = { F773742C19C770CB0039681C /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
......
...@@ -73,7 +73,6 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[]; ...@@ -73,7 +73,6 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYModelManager.h> #import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManagerProtocol.h> #import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYObjectProtocol.h> #import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYObserver.h>
#import <Buy/BUYShopifyErrorCodes.h> #import <Buy/BUYShopifyErrorCodes.h>
#import <Buy/BUYPaymentToken.h> #import <Buy/BUYPaymentToken.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#import "BUYSerializable.h" #import "BUYSerializable.h"
static NSString * const BUYShopifyErrorDomain = @"BUYShopifyErrorDomain"; static NSString * const BUYShopifyErrorDomain = @"BUYShopifyErrorDomain";
static NSString * const BUYClientVersionString = @"1.3";
static NSString * const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token"; static NSString * const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token";
typedef void (^BUYClientRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResponse *response, NSError *error); typedef void (^BUYClientRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResponse *response, NSError *error);
......
...@@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong, readonly, nonnull) NSString *appId; @property (nonatomic, strong, readonly, nonnull) NSString *appId;
/** /**
* Application name to attribute orders to. Defaults to app bundle name (CFBundleName) * Application name to attribute orders to. Uses the app bundle name from info.plist (CFBundleName)
*/ */
@property (nonatomic, strong, nonnull) NSString *applicationName; @property (nonatomic, strong, nonnull) NSString *applicationName;
......
...@@ -71,20 +71,35 @@ static NSString * const BUYClientJSONMimeType = @"application/json"; ...@@ -71,20 +71,35 @@ static NSString * const BUYClientJSONMimeType = @"application/json";
#pragma mark - Headers - #pragma mark - Headers -
- (NSBundle *)sdkBundle
{
return [NSBundle bundleForClass:[self class]];
}
- (NSString *)sdkVersion
{
return [[self sdkBundle] objectForInfoDictionaryKey:(id)kCFBundleVersionKey] ?: @"";
}
- (NSBundle *)appBundle
{
return [NSBundle mainBundle];
}
- (NSString *)applicationName - (NSString *)applicationName
{ {
return [[NSBundle mainBundle] infoDictionary][@"CFBundleName"] ?: @""; return [[self appBundle] objectForInfoDictionaryKey:(id)kCFBundleNameKey] ?: @"";
} }
- (NSString *)bundleIdentifier - (NSString *)appBundleIdentifier
{ {
return [[NSBundle mainBundle] bundleIdentifier]; return [[self appBundle] bundleIdentifier];
} }
- (NSDictionary *)additionalHeaders - (NSDictionary *)additionalHeaders
{ {
return @{ return @{
@"User-Agent": [NSString stringWithFormat:@"Mobile Buy SDK iOS/%@/%@", BUYClientVersionString, [self bundleIdentifier]] @"User-Agent": [NSString stringWithFormat:@"Mobile Buy SDK iOS/%@/%@", [self sdkVersion], [self appBundleIdentifier]]
}; };
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.2.6</string> <string>2.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
@interface BUYCollection : _BUYCollection {} @interface BUYCollection : _BUYCollection {}
@property (nonatomic, readonly) NSDate *createdAtDate NS_DEPRECATED_IOS(8_0, 9_0);
@property (nonatomic, readonly) NSDate *updatedAtDate NS_DEPRECATED_IOS(8_0, 9_0);
@property (nonatomic, readonly) NSDate *publishedAtDate NS_DEPRECATED_IOS(8_0, 9_0);
@property (nonatomic, readonly) NSURL *imageURL NS_DEPRECATED_IOS(8_0, 9_0);
@property (nonatomic, readonly) NSString *stringDescription; @property (nonatomic, readonly) NSString *stringDescription;
/** /**
......
...@@ -29,27 +29,6 @@ ...@@ -29,27 +29,6 @@
#import "NSString+BUYAdditions.h" #import "NSString+BUYAdditions.h"
@implementation BUYCollection @implementation BUYCollection
@synthesize stringDescription=_stringDescription;
- (NSDate *)createdAtDate
{
return self.createdAt;
}
- (NSDate *)updatedAtDate
{
return self.updatedAt;
}
- (NSDate *)publishedAtDate
{
return self.publishedAt;
}
- (NSURL *)imageURL
{
return self.image.sourceURL;
}
- (void)updateStringDescription - (void)updateStringDescription
{ {
......
...@@ -44,8 +44,6 @@ typedef NS_ENUM(NSUInteger, BUYImageURLSize) { ...@@ -44,8 +44,6 @@ typedef NS_ENUM(NSUInteger, BUYImageURLSize) {
@property (nonatomic, readonly, copy) NSDate *createdAtDate; @property (nonatomic, readonly, copy) NSDate *createdAtDate;
@property (nonatomic, readonly, copy) NSDate *updatedAtDate; @property (nonatomic, readonly, copy) NSDate *updatedAtDate;
@property (nonatomic, readonly) NSString *src NS_DEPRECATED_IOS(8_0, 9_0);
@end @end
......
...@@ -40,11 +40,6 @@ ...@@ -40,11 +40,6 @@
return self.updatedAt; return self.updatedAt;
} }
- (NSString *)src
{
return self.sourceURL.absoluteString;
}
@end @end
@implementation BUYImageLink (BUYImageSizing) @implementation BUYImageLink (BUYImageSizing)
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
@property (nonatomic) BOOL hasToken; @property (nonatomic) BOOL hasToken;
- (instancetype)initWithCart:(BUYCart *)cart NS_DEPRECATED_IOS(8_0, 9_0, "Use `BUYModelManager` to create new instances of model objects instead"); - (instancetype)initWithModelManager:(id<BUYModelManager>)modelManager cart:(BUYCart *)cart;
- (instancetype)initWithCartToken:(NSString *)token NS_DEPRECATED_IOS(8_0, 9_0, "Use `BUYModelManager` to create new instances of model objects instead");; - (instancetype)initWithModelManager:(id<BUYModelManager>)modelManager cartToken:(NSString *)token;
- (void)updateWithCart:(BUYCart *)cart; - (void)updateWithCart:(BUYCart *)cart;
......
...@@ -94,18 +94,18 @@ ...@@ -94,18 +94,18 @@
} }
#endif #endif
- (instancetype)initWithCart:(BUYCart *)cart - (instancetype)initWithModelManager:(id<BUYModelManager>)modelManager cart:(BUYCart *)cart
{ {
self = [self initWithModelManager:cart.modelManager JSONDictionary:nil]; self = [self initWithModelManager:modelManager JSONDictionary:nil];
if (self) { if (self) {
[self updateWithCart:cart]; [self updateWithCart:cart];
} }
return self; return self;
} }
- (instancetype)initWithCartToken:(NSString *)token - (instancetype)initWithModelManager:(id<BUYModelManager>)modelManager cartToken:(NSString *)token
{ {
self = [self initWithModelManager:nil JSONDictionary:nil]; self = [self initWithModelManager:modelManager JSONDictionary:nil];
if (self) { if (self) {
self.cartToken = token; self.cartToken = token;
} }
......
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
#import "BUYModelManager.h" #import "BUYModelManager.h"
#import "BUYModelManagerProtocol.h" #import "BUYModelManagerProtocol.h"
#import "BUYObjectProtocol.h" #import "BUYObjectProtocol.h"
#import "BUYObserver.h"
#import "BUYShopifyErrorCodes.h" #import "BUYShopifyErrorCodes.h"
#import "BUYPaymentToken.h" #import "BUYPaymentToken.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment