Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Facebook support #21

Merged
merged 2 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let package = Package(
.library(name: "UmbrellaFlurry", targets: ["UmbrellaFlurry"]),
.library(name: "UmbrellaLocalytics", targets: ["UmbrellaLocalytics"]),
.library(name: "UmbrellaMixpanel", targets: ["UmbrellaMixpanel"]),
.library(name: "UmbrellaFacebook", targets: ["UmbrellaFacebook"]),
.library(name: "UmbrellaIntercom", targets: ["UmbrellaIntercom"]),
],
targets: [
Expand All @@ -29,6 +30,7 @@ let package = Package(
.target(name: "UmbrellaFlurry", dependencies: ["Umbrella"]),
.target(name: "UmbrellaLocalytics", dependencies: ["Umbrella"]),
.target(name: "UmbrellaMixpanel", dependencies: ["Umbrella"]),
.target(name: "UmbrellaFacebook", dependencies: ["Umbrella"]),
.target(name: "UmbrellaIntercom", dependencies: ["Umbrella"]),
.testTarget(name: "UmbrellaTests", dependencies: ["Umbrella"]),
.testTarget(name: "UmbrellaAmplitudeTests", dependencies: ["UmbrellaAmplitude"]),
Expand All @@ -39,6 +41,7 @@ let package = Package(
.testTarget(name: "UmbrellaFlurryTests", dependencies: ["UmbrellaFlurry"]),
.testTarget(name: "UmbrellaLocalyticsTests", dependencies: ["UmbrellaLocalytics"]),
.testTarget(name: "UmbrellaMixpanelTests", dependencies: ["UmbrellaMixpanel"]),
.testTarget(name: "UmbrellaFacebookTests", dependencies: ["UmbrellaFacebook"]),
.testTarget(name: "UmbrellaIntercomTests", dependencies: ["UmbrellaIntercom"]),
],
swiftLanguageVersions: [.v5]
Expand Down
5 changes: 5 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ target 'UmbrellaMixpanelTests' do
pod 'Mixpanel'
end

target 'UmbrellaFacebookTests' do
platform :ios, '8.0'
pod 'FacebookSDK'
end

target 'UmbrellaIntercomTests' do
platform :ios, '8.0'
pod 'Intercom'
Expand Down
32 changes: 31 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,28 @@ PODS:
- Appboy-iOS-SDK/InAppMessage
- Appboy-iOS-SDK/NewsFeed
- AppsFlyerFramework (4.8.9)
- Bolts (1.9.0):
- Bolts/AppLinks (= 1.9.0)
- Bolts/Tasks (= 1.9.0)
- Bolts/AppLinks (1.9.0):
- Bolts/Tasks
- Bolts/Tasks (1.9.0)
- Fabric (1.7.12)
- FacebookSDK (4.38.0):
- Bolts (~> 1.9)
- FacebookSDK/CoreKit (= 4.38.0)
- FacebookSDK/MarketingKit (= 4.38.0)
- FacebookSDK/CoreKit (4.38.0):
- Bolts (~> 1.9)
- FBSDKCoreKit
- FacebookSDK/MarketingKit (4.38.0):
- Bolts (~> 1.9)
- FacebookSDK/CoreKit
- FBSDKMarketingKit
- FBSDKCoreKit (4.38.1):
- Bolts (~> 1.9)
- FBSDKMarketingKit (4.38.0):
- FBSDKCoreKit
- Firebase/Analytics (5.9.0):
- Firebase/Core
- Firebase/Core (5.9.0):
Expand Down Expand Up @@ -90,6 +111,7 @@ DEPENDENCIES:
- Answers
- Appboy-iOS-SDK
- AppsFlyerFramework
- FacebookSDK
- Firebase/Analytics
- Flurry-iOS-SDK/FlurrySDK
- Intercom
Expand All @@ -102,7 +124,11 @@ SPEC REPOS:
- Answers
- Appboy-iOS-SDK
- AppsFlyerFramework
- Bolts
- Fabric
- FacebookSDK
- FBSDKCoreKit
- FBSDKMarketingKit
- Firebase
- FirebaseAnalytics
- FirebaseCore
Expand All @@ -122,7 +148,11 @@ SPEC CHECKSUMS:
Answers: bca35eedaed069c392d01b9dcb2673e0f77d9926
Appboy-iOS-SDK: c245f36aafe6e1b5249a8924e598e82e1c233f5d
AppsFlyerFramework: 0fc823ec9b77f913e4108caa82c969be033058b1
Bolts: ac6567323eac61e203f6a9763667d0f711be34c8
Fabric: d7387db9a31aadff63b147a4b91d982c53afaa4f
FacebookSDK: 73f54b8b94e09b05647cdef0af147f470cd3edc6
FBSDKCoreKit: 8d47857400e2f5bdea697a80daff882e91c84ef6
FBSDKMarketingKit: e609f39d74ab273cf52e2f8b7e8829ed412b2827
Firebase: 383fa29aca93e371cab776b48a5c66544d3c2003
FirebaseAnalytics: 831f1f127f4a75698e9875a87bf7e2668730d953
FirebaseCore: 2a84b6b325792a4319ef71ee18819dcba08d2fd7
Expand All @@ -137,6 +167,6 @@ SPEC CHECKSUMS:
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681

PODFILE CHECKSUM: c2b33191dbaf3828d8713a63f563b79f92e1f065
PODFILE CHECKSUM: 3a6bfed87c56cfc95bd08d74892e8b6b468388cf

COCOAPODS: 1.9.3
13 changes: 13 additions & 0 deletions Sources/UmbrellaFacebook/FacebookProvider.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Foundation

#if !COCOAPODS
import Umbrella
#endif

open class FacebookProvider: RuntimeProviderType {
public let className: String = "FBSDKAppEvents"
public let selectorName: String = "logEvent:parameters:"

public init() {
}
}
14 changes: 14 additions & 0 deletions Tests/UmbrellaFacebookTests/FacebookProviderTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import XCTest
import Umbrella
import UmbrellaFacebook
import FBSDKCoreKit

final class FacebookProviderTests: XCTestCase {
func testFacebookProvider() {
let provider = FacebookProvider()
XCTAssertTrue(provider.cls === FBSDKAppEvents.self)
XCTAssertNil(provider.instance)
XCTAssertEqual(provider.selector, #selector(FBSDKAppEvents.logEvent(_:parameters:)))
XCTAssertTrue(provider.responds)
}
}
5 changes: 5 additions & 0 deletions Umbrella.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ Pod::Spec.new do |s|
ss.dependency "Umbrella/Core"
end

s.subspec "Facebook" do |ss|
ss.source_files = "Sources/UmbrellaFacebook/*.swift"
ss.dependency "Umbrella/Core"
end

s.subspec "Intercom" do |ss|
ss.source_files = "Sources/UmbrellaIntercom/*.swift"
ss.dependency "Umbrella/Core"
Expand Down