Skip to content

Commit

Permalink
Merge pull request #105 from Giphy/task/make-it-run-on-tvos
Browse files Browse the repository at this point in the history
Compile for tvOS
  • Loading branch information
giorgia authored Jan 28, 2020
2 parents 083b55f + c2e9aa6 commit 3144c3a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions GiphyCoreSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
2335561823DF741500DDC899 /* OMSDK_Giphy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD473ED0234B988800843E7D /* OMSDK_Giphy.framework */; };
239D4005228F45D0004D4B64 /* GPHMedia+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239D4004228F45D0004D4B64 /* GPHMedia+Additions.swift */; };
AF05A7A31F66DB940095F5BA /* GPHChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF05A7A21F66DB940095F5BA /* GPHChannel.swift */; };
AF05A7A51F66E1560095F5BA /* GPHChannelResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF05A7A41F66E1560095F5BA /* GPHChannelResponse.swift */; };
Expand Down Expand Up @@ -405,6 +406,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2335561823DF741500DDC899 /* OMSDK_Giphy.framework in Frameworks */,
FDAA1ACB2200FBF7009D34F4 /* GiphyPingbackSDK.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1282,6 +1284,7 @@
"$(inherited)",
"$(PROJECT_DIR)-auth/Carthage/Build/tvOS",
"$(PROJECT_DIR)/Carthage/Build/tvOS/Static",
"$(PROJECT_DIR)/omsdk-ios-1.2.20-Giphy",
);
INFOPLIST_FILE = Sources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -1313,6 +1316,7 @@
"$(inherited)",
"$(PROJECT_DIR)-auth/Carthage/Build/tvOS",
"$(PROJECT_DIR)/Carthage/Build/tvOS/Static",
"$(PROJECT_DIR)/omsdk-ios-1.2.20-Giphy",
);
INFOPLIST_FILE = Sources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -1377,6 +1381,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac/Static",
"$(PROJECT_DIR)/omsdk-ios-1.2.20-Giphy",
);
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Sources/Info.plist;
Expand Down Expand Up @@ -1408,6 +1413,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac/Static",
"$(PROJECT_DIR)/omsdk-ios-1.2.20-Giphy",
);
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Sources/Info.plist;
Expand Down
2 changes: 1 addition & 1 deletion Sources/GPHListMediaResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extension GPHListMediaResponse: GPHMappable {
results = []
for result in mediaData {
let result = try GPHMedia.mapData(result, options: options)
#if os(iOS)
#if os(iOS) || os(tvOS)
result.responseId = meta.responseId
#endif
if result.isValidObject() {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GPHMedia+Pingbacks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Cem Kozinoglu on 3/13/18.
// Copyright © 2018 Giphy. All rights reserved.
//
#if os(iOS)
#if os(iOS) || os(tvOS)

import Foundation

Expand Down
4 changes: 2 additions & 2 deletions Sources/GPHMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#if os(iOS)
#if os(iOS) || os(tvOS)
import OMSDK_Giphy
#endif

Expand Down Expand Up @@ -322,7 +322,7 @@ extension GPHMedia: GPHMappable {
obj.bottleData = try GPHBottleData.mapData(bottleData, options: optionsCopy)
}

#if os(iOS)
#if os(iOS) || os(tvOS)

// Store the request type in the GPHMedia so we can include in Pingbacks data
switch requestType {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GPHMediaResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ extension GPHMediaResponse: GPHMappable {
let data = try GPHMedia.mapData(mediaData, options: options)

// Store the response ID in the GPHMedia so we can include in Pingbacks data
#if os(iOS)
#if os(iOS) || os(tvOS)
data.responseId = meta.responseId
#endif
if data.isValidObject() {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GPHRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public enum GPHRequestRouter {
}

// Propagate the headers to Pingbacks
#if os(iOS)
#if os(iOS) || os(tvOS)
GiphyPingbacks.addAdditionalHeaders(parameters: request.allHTTPHeaderFields)
#endif

Expand Down
6 changes: 4 additions & 2 deletions Sources/GiphyCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2018 Giphy. All rights reserved.
//

#if os(iOS)
#if os(iOS) || os(tvOS)
import OMSDK_Giphy
#endif

Expand Down Expand Up @@ -38,10 +38,12 @@ import Foundation
shared.apiKey = apiKey
GiphyCore.enableLogs = (Bundle.main.object(forInfoDictionaryKey: "GiphyEnableLogs") as? Bool) ?? false

#if os(iOS)
#if os(iOS) || os(tvOS)
GiphyPingbacks.configure(apiKey: apiKey, verificationMode: verificationMode)
GiphyPingbacks.enableDebugLogging(GiphyCore.enableLogs)
#endif

#if os(iOS)
GiphyCore.enableOM = !isAppExtension
if let omVal = Bundle.main.object(forInfoDictionaryKey: "GiphyDisableOpenMeasurement") as? Bool, omVal == true {
GiphyCore.enableOM = false
Expand Down
2 changes: 1 addition & 1 deletion Sources/GiphyTracking.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS)
#if os(iOS) || os(tvOS)
import OMSDK_Giphy
import UIKit

Expand Down

0 comments on commit 3144c3a

Please sign in to comment.