-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## New * An .xcframework is now provided with frameworks for supported platforms * The recommended install method for new installs is now using the framework, rather than cocoapods (note that cocoapods also remains a supported install method) ## Fixed * cache now correctly stores successful responses and can reuse them if subsequent responses return errors * Cocoapods install should now install without build errors Co-authored-by: Aga Magiera <[email protected]> Co-authored-by: George Burslem <[email protected]> Co-authored-by: Phil Cooper-King <[email protected]> Co-authored-by: Tom Thompson <[email protected]>
- Loading branch information
1 parent
e744adb
commit 11d9e3b
Showing
93 changed files
with
3,833 additions
and
4,796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Git Attributes | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Line Endings | ||
|
||
* text=auto | ||
|
||
# Source Files | ||
*.m eol=lf | ||
*.mm eol=lf | ||
*.swift eol=lf | ||
*.h eol=lf | ||
|
||
*.txt eol=lf | ||
*.md eol=lf | ||
|
||
# Batch Files | ||
*.sh text eol=lf | ||
*.{bat,[bB][aA][tT]} text eol=crlf | ||
*.{cmd,[cC][mM][dD]} text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
buildFrameworks: | ||
name: Build Frameworks for Release | ||
agent: | ||
type: Unity::VM::osx | ||
image: desktop/unity-macos-10.15-xcode-12.2:stable | ||
flavor: m1.mac | ||
commands: | ||
- bash buildFrameworks.sh | ||
artifacts: | ||
build: | ||
paths: | ||
- "build/DeltaDNA-iOS.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
tests: | ||
name: Test deltaDNA iOS SDK | ||
agent: | ||
type: Unity::VM::osx | ||
image: desktop/unity-macos-10.15-xcode-12.2:stable | ||
flavor: m1.mac | ||
triggers: | ||
cancel_old_ci: true | ||
expression: pull_request.target EQ "develop" OR pull_request.target EQ "master" | ||
commands: | ||
- xcodebuild -workspace "DeltaDNA.xcworkspace" -scheme "DeltaDNA iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.2' clean test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
import XCTest | ||
@testable import DeltaDNA | ||
|
||
class DDNATransactionTests: XCTestCase { | ||
|
||
var productsReceived: DDNAProduct! = DDNAProduct() | ||
var productsSpent: DDNAProduct! = DDNAProduct() | ||
var transaction: DDNATransaction! | ||
|
||
func test_createTransaction_dictionaryReturnsExpectedResult() throws { | ||
transaction = DDNATransaction(name: "shop", type: "weapon", productsReceived: productsReceived, productsSpent: productsSpent) | ||
|
||
let result: [String : Any] = ["eventName" : "transaction", | ||
"eventParams" : [ | ||
"transactionName" : "shop", | ||
"transactionType" : "weapon", | ||
"productsReceived" : [:], | ||
"productsSpent" : [:] | ||
]] | ||
|
||
XCTAssertEqual(transaction.dictionary() as NSDictionary, result as NSDictionary) | ||
} | ||
|
||
func test_createTransation_includeOptionalValues_dictionaryReturnsExpectedResult() throws { | ||
transaction = DDNATransaction(name: "shop", type: "weapon", productsReceived: productsReceived, productsSpent: productsSpent) | ||
transaction.setTransactionId("12345") | ||
transaction.setServer("local") | ||
transaction.setReceipt("123223----***5433") | ||
transaction.setTransactorId("abcde") | ||
transaction.setProductId("5678-4332") | ||
|
||
let result: [String : Any] = ["eventName" : "transaction", | ||
"eventParams" : [ | ||
"transactionName" : "shop", | ||
"transactionType" : "weapon", | ||
"productsReceived" : [:], | ||
"productsSpent" : [:], | ||
"transactionID": "12345", | ||
"transactionServer": "local", | ||
"transactionReceipt": "123223----***5433", | ||
"transactorID": "abcde", | ||
"productID": "5678-4332" | ||
]] | ||
|
||
XCTAssertEqual(transaction.dictionary() as NSDictionary, result as NSDictionary) | ||
} | ||
|
||
func test_nameIsNil_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: nil, type: "weapon", productsReceived: self.productsReceived, productsSpent: self.productsSpent) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "name cannot be nil or empty") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
func test_nameIsEmptyString_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: "", type: "weapon", productsReceived: self.productsReceived, productsSpent: self.productsSpent) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "name cannot be nil or empty") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
func test_typeIsNil_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: "shop", type: nil, productsReceived: self.productsReceived, productsSpent: self.productsSpent) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "type cannot be nil or empty") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
func test_typeIsEmptyString_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: "shop", type: "", productsReceived: self.productsReceived, productsSpent: self.productsSpent) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "type cannot be nil or empty") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
func test_productsReceivedIsNil_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: "shop", type: "weapon", productsReceived: nil, productsSpent: self.productsSpent) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "productsReceived cannot be nil") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
func test_productsSpentIsEmptyString_throwInvalidArgumentException() throws { | ||
do { | ||
try ObjC.catchException { | ||
let _ = DDNATransaction(name: "shop", type: "weapon", productsReceived: self.productsReceived, productsSpent: nil) | ||
} | ||
} | ||
catch { | ||
let error = error as NSError | ||
XCTAssertNotNil(error) | ||
XCTAssertEqual(error.domain, NSExceptionName.invalidArgumentException.rawValue) | ||
XCTAssertEqual(error.localizedFailureReason, "productsSpent cannot be nil") | ||
return | ||
} | ||
XCTFail() | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#import "DDNAActionStore.h" | ||
#import "DDNAEventTrigger.h" | ||
#import "DDNASettings.h" | ||
#import "DDNAUtils.h" | ||
#import "DDNAInstanceFactory.h" | ||
#import "DDNANetworkRequest.h" | ||
#import "DDNAEngageService.h" | ||
#import "DDNAInstanceFactory.h" | ||
#import "DDNAEngageCache.h" | ||
#import "DDNAVolatileEventStore.h" | ||
#import "DDNAProduct.h" | ||
#import "ObjC.h" | ||
#import "DDNASdkInterface.h" | ||
#import "DDNAUserManager.h" | ||
#import "NSURL+DeltaDNA.h" | ||
#import "DDNAImageCache.h" | ||
#import "DDNATransaction.h" | ||
#import "DDNAEventTrigger.h" | ||
#import "NSURLSessionInterface.h" | ||
#import "DDNANonTrackingSdk.h" | ||
#import "DDNACollectService.h" | ||
#import "NSDictionary+DeltaDNA.h" | ||
#import "DDNAUserManager.h" | ||
#import "DDNATrackingSdk.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.