Skip to content

Commit

Permalink
Merge pull request #14 from devxoul/amplitude
Browse files Browse the repository at this point in the history
Add Amplitude support
  • Loading branch information
devxoul authored Dec 1, 2017
2 parents cf9ad4a + 7fbb492 commit acba7bb
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let package = Package(
name: "Umbrella",
products: [
.library(name: "Umbrella", targets: ["Umbrella"]),
.library(name: "UmbrellaAmplitude", targets: ["UmbrellaAmplitude"]),
.library(name: "UmbrellaAnswers", targets: ["UmbrellaAnswers"]),
.library(name: "UmbrellaAppboy", targets: ["UmbrellaAppboy"]),
.library(name: "UmbrellaAppsFlyer", targets: ["UmbrellaAppsFlyer"]),
Expand All @@ -16,13 +17,15 @@ let package = Package(
],
targets: [
.target(name: "Umbrella"),
.target(name: "UmbrellaAmplitude", dependencies: ["Umbrella"]),
.target(name: "UmbrellaAnswers", dependencies: ["Umbrella"]),
.target(name: "UmbrellaAppboy", dependencies: ["Umbrella"]),
.target(name: "UmbrellaAppsFlyer", dependencies: ["Umbrella"]),
.target(name: "UmbrellaFirebase", dependencies: ["Umbrella"]),
.target(name: "UmbrellaFlurry", dependencies: ["Umbrella"]),
.target(name: "UmbrellaLocalytics", dependencies: ["Umbrella"]),
.target(name: "UmbrellaMixpanel", dependencies: ["Umbrella"]),
.testTarget(name: "UmbrellaAmplitudeTests", dependencies: ["UmbrellaAmplitude"]),
.testTarget(name: "UmbrellaAnswersTests", dependencies: ["UmbrellaAnswers"]),
.testTarget(name: "UmbrellaAppboyTests", dependencies: ["UmbrellaAppboy"]),
.testTarget(name: "UmbrellaAppsFlyerTests", dependencies: ["UmbrellaAppsFlyer"]),
Expand Down
5 changes: 5 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use_frameworks!
inhibit_all_warnings!

target 'UmbrellaAmplitudeTests' do
platform :ios, '8.0'
pod 'Amplitude-iOS'
end

target 'UmbrellaAnswersTests' do
platform :ios, '8.0'
pod 'Answers'
Expand Down
5 changes: 4 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PODS:
- Amplitude-iOS (4.0.4)
- Answers (1.3.4):
- Fabric (~> 1.6.3)
- Appboy-iOS-SDK (3.0.0):
Expand Down Expand Up @@ -35,6 +36,7 @@ PODS:
- SDWebImage/Core

DEPENDENCIES:
- Amplitude-iOS
- Answers
- Appboy-iOS-SDK
- AppsFlyerFramework
Expand All @@ -44,6 +46,7 @@ DEPENDENCIES:
- Mixpanel

SPEC CHECKSUMS:
Amplitude-iOS: 2ad4d7270c99186236c1272a3a9425463b1ae1a7
Answers: 6a4d22973d8550808630a55f526055c9eb6d39a2
Appboy-iOS-SDK: b78abfe6915d4a62634e5e9581ce3a6fc13ef353
AppsFlyerFramework: ece902d4233177d4e9db1429c7a5df5fad8e9f07
Expand All @@ -59,6 +62,6 @@ SPEC CHECKSUMS:
Mixpanel: 9b33e5de998cd42597767f67e2b8fcd1d158c71d
SDWebImage: 0e435c14e402a6730315a0fb79f95e68654d55a4

PODFILE CHECKSUM: 36988e53c5e56be55a41f802ffa3c350ad504748
PODFILE CHECKSUM: 27e47646f9da8c60f83deba571e7d9a924c84a33

COCOAPODS: 1.3.1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ analytics.log(.signup(username: "devxoul"))

There are several built-in providers.

* AmplitudeProvider ([Amplitude-iOS](https://cocoapods.org/pods/Amplitude-iOS))
* AnswersProvider ([Answers](https://cocoapods.org/pods/Answers))
* AppboyProvider ([Appboy-iOS-SDK](http://cocoapods.org/pods/Appboy-iOS-SDK))
* AppsFlyerProvider ([AppsFlyerFramework](http://cocoapods.org/pods/AppsFlyerFramework))
Expand Down
13 changes: 13 additions & 0 deletions Sources/UmbrellaAmplitude/AmplitudeProvider.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Foundation

#if !COCOAPODS
import Umbrella
#endif

open class AmplitudeProvider: RuntimeProviderType {
open let className: String = "Amplitude"
open let selectorName: String = "logEvent:withEventProperties:"

public init() {
}
}
14 changes: 14 additions & 0 deletions Tests/UmbrellaAmplitudeTests/AmplitudeProviderTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import XCTest
import Umbrella
import UmbrellaAmplitude
import Amplitude_iOS

final class AmplitudeProviderTests: XCTestCase {
func testAmplitudeProvider() {
let provider = AmplitudeProvider()
XCTAssertTrue(provider.cls === Amplitude.self)
XCTAssertNil(provider.instance)
XCTAssertEqual(provider.selector, #selector(Amplitude.logEvent(_:withEventProperties:)))
XCTAssertTrue(provider.responds)
}
}

0 comments on commit acba7bb

Please sign in to comment.