Skip to content

Commit 0e6ba36

Browse files
committed
Update to Ignite 1.13.5, refactored CustomModules code
1 parent fa89f42 commit 0e6ba36

File tree

6 files changed

+37
-32
lines changed

6 files changed

+37
-32
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ This is an example integration of the Ticketmaster Ignite SDK, Retail, Tickets,
1616
* Retail SDK: https://ignite.ticketmaster.com/docs/ios-retail-change-log
1717
* Authentication SDK: https://ignite.ticketmaster.com/docs/ios-authentication-change-log
1818

19-
## Demo App Screenshots
20-
21-
<img src="Screenshots/MainMenu.jpg" alt="Main Menu" /> <img src="Screenshots/DiscoveryAPI.jpg" alt="DiscoveryAPI" />
22-
<img src="Screenshots/Homepage.jpg" alt="Homepage" /> <img src="Screenshots/AttractionEvents.jpg" alt="Attraction Details Page" /> <img src="Screenshots/VenueEvents.jpg" alt="Venue Details Page" />
23-
<img src="Screenshots/Purchase.jpg" alt="Event Details Page" />
24-
<img src="Screenshots/PurchasedEvents.jpg" alt="Purchased Events Listing Page" /> <img src="Screenshots/Tickets.jpg" alt="Purchased Tickets Listing Page" />
25-
26-
2719
## Getting Started
2820

2921
1. Open **TMSDKDemoIntegration.xcodeproj** using Swift 5.9+ (Xcode 15.0.1+ or Xcode 16.0+)
@@ -33,3 +25,17 @@ This is an example integration of the Ticketmaster Ignite SDK, Retail, Tickets,
3325
4. Build and Run **TMSDKDemoIntegration** target
3426

3527
<img src="Screenshots/Project.jpg" alt="Project Contents" />
28+
29+
## Demo App Screenshots
30+
31+
### Main Menu
32+
<img src="Screenshots/MainMenu.jpg" alt="Main Menu" /> <img src="Screenshots/DiscoveryAPI.jpg" alt="DiscoveryAPI" />
33+
34+
### Retail SDK
35+
<img src="Screenshots/Homepage.jpg" alt="Homepage" /> <img src="Screenshots/AttractionEvents.jpg" alt="Attraction Details Page" /> <img src="Screenshots/VenueEvents.jpg" alt="Venue Details Page" /> <img src="Screenshots/Purchase.jpg" alt="Event Details Page" />
36+
37+
### Tickets SDK
38+
<img src="Screenshots/PurchasedEvents.jpg" alt="Purchased Events Listing Page" /> <img src="Screenshots/Tickets.jpg" alt="Purchased Tickets Listing Page" />
39+
40+
### Tickets SDK: Custom Modules
41+
<img src="Screenshots/CustomModules.jpg" alt="Custom Modules" />

Screenshots/CustomModules.jpg

183 KB
Loading

TMSDKDemoIntegration.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
79E8C0852A5656BF0054B340 /* DictionaryExplorerTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DictionaryExplorerTextView.swift; sourceTree = "<group>"; };
241241
79E8C0862A5656BF0054B340 /* DiscoveryVC+BuildMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DiscoveryVC+BuildMenu.swift"; sourceTree = "<group>"; };
242242
79E8C08F2A56584C0054B340 /* DiscoveryHelper+APICalls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiscoveryHelper+APICalls.swift"; sourceTree = "<group>"; };
243+
79FE1DF32D6E54BF0070652F /* Screenshots */ = {isa = PBXFileReference; lastKnownFileType = text; path = Screenshots; sourceTree = SOURCE_ROOT; };
243244
/* End PBXFileReference section */
244245

245246
/* Begin PBXFrameworksBuildPhase section */
@@ -327,6 +328,7 @@
327328
79E8BFF92A5626160054B340 /* Documentation */ = {
328329
isa = PBXGroup;
329330
children = (
331+
79FE1DF32D6E54BF0070652F /* Screenshots */,
330332
795D32F22A56781C001D0466 /* README.md */,
331333
);
332334
path = Documentation;
@@ -997,7 +999,7 @@
997999
repositoryURL = "https://github.com/ticketmaster/iOS-TicketmasterSDK.git";
9981000
requirement = {
9991001
kind = exactVersion;
1000-
version = 1.13.4;
1002+
version = 1.13.5;
10011003
};
10021004
};
10031005
/* End XCRemoteSwiftPackageReference section */

TMSDKDemoIntegration/Logic/Tickets/TicketsHelper+CustomModules.swift

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import TicketmasterDiscoveryAPI // for DiscoveryEventSearchCriteria
1212

1313
extension TicketsHelper {
1414

15-
func addCustomModules(event: TMPurchasedEvent) -> [TMTicketsModule] {
15+
/// see Documentation/Screenshots/CustomModules for examples
16+
func buildCustomModules(event: TMPurchasedEvent, completion: @escaping (_ customModules: [TMTicketsModule]) -> Void) {
1617
print(" - Adding Custom Modules")
1718
var output: [TMTicketsModule] = []
1819

@@ -51,18 +52,16 @@ extension TicketsHelper {
5152
output.append(module)
5253
}
5354

54-
return output
55-
}
56-
57-
func addCustomAsyncModules(event: TMPurchasedEvent, completion: @escaping (_ modules: [TMTicketsModule]) -> Void) {
58-
print(" - Adding Custom Modules (async)")
59-
var output: [TMTicketsModule] = []
60-
55+
// build upcoming home games module (see Documentation/Screenshots/CustomModules for example)
56+
// this module uses a network call to Discovery API to find home games
6157
nextHomeGameModule(event: event) { nextEventModule in
58+
// this returns on the networking thread
6259
if let nextEventModule = nextEventModule {
6360
output.append(nextEventModule)
6461
}
6562

63+
// use an async completion in case any of these custom modules need to make a network request
64+
// like nextHomeGameModule
6665
completion(output)
6766
}
6867
}
@@ -398,7 +397,4 @@ extension TicketsHelper {
398397
headerDisplay: headerDisplay,
399398
actionButtons: [gamesActionButton]) // you can show 0 to 3 buttons
400399
}
401-
402-
403-
404400
}

TMSDKDemoIntegration/Logic/Tickets/TicketsHelper+ModuleDelegate.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ extension TicketsHelper: TMTicketsModuleDelegate {
2121
print("Add Modules...")
2222
var modules: [TMTicketsModule] = []
2323

24-
// add prebuilt modules (optional)
25-
modules.append(contentsOf: addPreBuiltModules(event: event))
26-
27-
// add custom modules (optional)
28-
modules.append(contentsOf: addCustomModules(event: event))
29-
30-
addCustomAsyncModules(event: event) { asyncModules in
31-
modules.append(contentsOf: asyncModules)
24+
buildPreBuiltModules(event: event) { prebuiltModules in
25+
// add prebuilt modules (optional)
26+
modules.append(contentsOf: prebuiltModules)
3227

33-
// return list of modules (in the order you want them displayed)
34-
completion(modules)
28+
self.buildCustomModules(event: event) { customModules in
29+
// add custom modules (optional)
30+
modules.append(contentsOf: customModules)
31+
32+
// return list of modules (in the order you want them displayed)
33+
completion(modules)
34+
}
3535
}
3636
}
3737

TMSDKDemoIntegration/Logic/Tickets/TicketsHelper+PrebuiltModules.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import TicketmasterTickets // for TMPurchasedEvent, TMTicketsModule and TMTicket
1010

1111
extension TicketsHelper {
1212

13-
func addPreBuiltModules(event: TMPurchasedEvent) -> [TMTicketsModule] {
13+
func buildPreBuiltModules(event: TMPurchasedEvent, completion: @escaping (_ prebuiltModules: [TMTicketsModule]) -> Void) {
1414
print(" - Adding Prebuilt Modules")
1515
var output: [TMTicketsModule] = []
1616

@@ -64,6 +64,7 @@ extension TicketsHelper {
6464
}
6565
#endif
6666

67-
return output
67+
// use an async completion in case any of these prebuilt modules need to make a network request
68+
completion(output)
6869
}
6970
}

0 commit comments

Comments
 (0)