Skip to content

Commit

Permalink
4.13.0 (#26)
Browse files Browse the repository at this point in the history
## 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
5 people authored and GitHub Enterprise committed Mar 11, 2021
1 parent e744adb commit 11d9e3b
Show file tree
Hide file tree
Showing 93 changed files with 3,833 additions and 4,796 deletions.
20 changes: 20 additions & 0 deletions .gitattributes
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Xcode
#
build/
archives/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -19,7 +20,7 @@ DerivedData

# CocoaPods
Tests/Pods
Tests/Podfile.lock
Pods

.DS_Store

12 changes: 12 additions & 0 deletions .yamato/build.yaml
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"
11 changes: 11 additions & 0 deletions .yamato/test.yml
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [4.13.0](https://github.com/deltaDNA/ios-sdk/releases/tag/4.13.0) (2021-03-11)
### 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

## [4.12.4](https://github.com/deltaDNA/ios-sdk/releases/tag/4.12.4) (2021-01-12)
### Added
- device client info contains entries for newer iPhone and iPad models
Expand Down
254 changes: 254 additions & 0 deletions DDNAEventTriggerTests.swift

Large diffs are not rendered by default.

145 changes: 145 additions & 0 deletions DDNATransactionTests.swift
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()
}


}
24 changes: 24 additions & 0 deletions DeltaDNA iOS Tests-Bridging-Header.h
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"
24 changes: 3 additions & 21 deletions DeltaDNA.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|

# Spec Metadata
spec.name = "DeltaDNA"
spec.version = "4.12.4"
spec.version = "4.13.0"
spec.summary = "A gaming analytics platform."

spec.homepage = "https://deltadna.com"
Expand All @@ -18,27 +18,9 @@ Pod::Spec.new do |spec|
spec.tvos.deployment_target = "9.2"

# Source Location
spec.source = { :git => "https://github.com/deltaDNA/ios-sdk.git", :tag => spec.version }
spec.source = { :http => "https://github.com/deltaDNA/ios-sdk/releases/download/4.13.0/DeltaDNA-iOS.tar.gz" }

# Source Code
spec.source_files = "DeltaDNA", "DeltaDNA/**/*.{h,m,swift}"
spec.public_header_files = "DeltaDNA/**/*.h"
spec.tvos.exclude_files = [
"DeltaDNA/Framework/iOS/*.{h,m,swift}",
"DeltaDNA/**/DDNAPinpointer.swift",
"DeltaDNA/**/DDNANotifications*.{h,m,swift}"
]
spec.ios.exclude_files = [
"DeltaDNA/**/DDNAPinpointerTvOS.swift",
"DeltaDNA/Framework/tvOS/*.{h,m,swift}"
]

# Resources
spec.resources = "DeltaDNA/Resources/**/*"

# Project Linking

# Project Settings
spec.requires_arc = true
spec.vendored_frameworks = 'build/Frameworks/DeltaDNA.xcframework'

end
Loading

0 comments on commit 11d9e3b

Please sign in to comment.