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 Intercom support #20

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: "UmbrellaIntercom", targets: ["UmbrellaIntercom"]),
],
targets: [
.target(name: "Umbrella"),
Expand All @@ -28,6 +29,7 @@ let package = Package(
.target(name: "UmbrellaFlurry", dependencies: ["Umbrella"]),
.target(name: "UmbrellaLocalytics", dependencies: ["Umbrella"]),
.target(name: "UmbrellaMixpanel", dependencies: ["Umbrella"]),
.target(name: "UmbrellaIntercom", dependencies: ["Umbrella"]),
.testTarget(name: "UmbrellaTests", dependencies: ["Umbrella"]),
.testTarget(name: "UmbrellaAmplitudeTests", dependencies: ["UmbrellaAmplitude"]),
.testTarget(name: "UmbrellaAnswersTests", dependencies: ["UmbrellaAnswers"]),
Expand All @@ -37,6 +39,7 @@ let package = Package(
.testTarget(name: "UmbrellaFlurryTests", dependencies: ["UmbrellaFlurry"]),
.testTarget(name: "UmbrellaLocalyticsTests", dependencies: ["UmbrellaLocalytics"]),
.testTarget(name: "UmbrellaMixpanelTests", dependencies: ["UmbrellaMixpanel"]),
.testTarget(name: "UmbrellaIntercomTests", dependencies: ["UmbrellaIntercom"]),
],
swiftLanguageVersions: [.v5]
)
5 changes: 5 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ target 'UmbrellaMixpanelTests' do
platform :ios, '8.0'
pod 'Mixpanel'
end

target 'UmbrellaIntercomTests' do
platform :ios, '8.0'
pod 'Intercom'
end
6 changes: 5 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ PODS:
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (5.3.0):
- GoogleUtilities/Logger
- Intercom (5.1.9)
- Localytics (5.3.0)
- Mixpanel (3.3.3)
- nanopb (0.3.8):
Expand All @@ -91,6 +92,7 @@ DEPENDENCIES:
- AppsFlyerFramework
- Firebase/Analytics
- Flurry-iOS-SDK/FlurrySDK
- Intercom
- Localytics
- Mixpanel

Expand All @@ -109,6 +111,7 @@ SPEC REPOS:
- Flurry-iOS-SDK
- GoogleAppMeasurement
- GoogleUtilities
- Intercom
- Localytics
- Mixpanel
- nanopb
Expand All @@ -128,11 +131,12 @@ SPEC CHECKSUMS:
Flurry-iOS-SDK: e5d6ff8cb79b5044710a0c7ae41b12ac651f4315
GoogleAppMeasurement: 2b3a023a61239c8d002e6e4fcf4abce8eddce0e0
GoogleUtilities: 760ccb53b7c7f40f9c02d8c241f76f841a7a6162
Intercom: ab60831c72fe5ff3edfa2d3a2352d06435a85478
Localytics: aa49adf35bd480a598c98f525a86d4c5b91debe8
Mixpanel: 3c3925c27f7a321d5978319a72f53f8f0885afc5
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681

PODFILE CHECKSUM: 27e47646f9da8c60f83deba571e7d9a924c84a33
PODFILE CHECKSUM: c2b33191dbaf3828d8713a63f563b79f92e1f065

COCOAPODS: 1.9.3
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ There are several built-in providers.
* FlurryProvider ([Flurry-iOS-SDK/FabricSDK](https://cocoapods.org/pods/Flurry-iOS-SDK))
* LocalyticsProvider ([Localytics](https://cocoapods.org/pods/Localytics))
* MixpanelProvider ([Mixpanel](https://cocoapods.org/pods/Mixpanel))
* IntercomProvider ([Intercom](https://cocoapods.org/pods/Intercom))

If there's no provider you're looking for, you can [create an issue](https://github.com/devxoul/Umbrella/issues/new) or [create custom providers](#creating-custom-providers). It's also welcomed to create a pull request for missing services 🎉

Expand Down
14 changes: 14 additions & 0 deletions Sources/UmbrellaIntercom/IntercomProvider.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Foundation

#if !COCOAPODS
import Umbrella
#endif

open class IntercomProvider: RuntimeProviderType {
public let className: String = "Intercom"
public let selectorName: String = "logEventWithName:metaData:"

public init() {
}
}

26 changes: 26 additions & 0 deletions Tests/UmbrellaIntercomTests/UmbrellaIntercomTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// UmbrellaIntercomTests.swift
// UmbrellaIntercomTests
//
// Created by Sygnoos9 on 11/17/18.
//

import XCTest
import Umbrella
@testable import UmbrellaIntercom
import Intercom

class UmbrellaIntercomTests: XCTestCase {
override func setUp() {
super.setUp()
Intercom.setApiKey("TEST_TOKEN", forAppId: "TEST_APP_ID")
}

func testMixpanelProvider() {
let provider = IntercomProvider()
XCTAssertTrue(provider.cls === Intercom.self)
XCTAssertNil(provider.instance)
XCTAssertEqual(provider.selector, #selector(Intercom.logEvent(withName:metaData:)))
XCTAssertTrue(provider.responds)
}
}
5 changes: 5 additions & 0 deletions Umbrella.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@ Pod::Spec.new do |s|
ss.source_files = "Sources/UmbrellaMixpanel/*.swift"
ss.dependency "Umbrella/Core"
end

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