Skip to content

Commit ae65ca6

Browse files
Initial integration development
1 parent f464aab commit ae65ca6

File tree

18 files changed

+2302
-1
lines changed

18 files changed

+2302
-1
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Pods/
4949
# Add this line if you want to avoid checking in source code from Carthage dependencies.
5050
Carthage/
5151
Cartfile.resolved
52+
Carthage/Checkouts
53+
Carthage/Build
5254

5355
# fastlane
5456
#
@@ -63,4 +65,7 @@ fastlane/screenshots
6365
fastlane/test_output
6466

6567
**/Podfile.lock
66-
**/*.xcworkspace
68+
**/*.xcworkspace
69+
**/Cartfile.resolved
70+
**/Pods
71+
**/*.framework.zip

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
osx_image: xcode10
2+
language: objective-c
3+
script:
4+
- sudo gem install cocoapods -v 1.5.3
5+
- travis_retry pod repo update > /dev/null
6+
- pod lib lint --use-libraries --allow-warnings || pod lib lint --allow-warnings
7+
- carthage update
8+
- carthage build --no-skip-current && carthage archive
9+
- xcodebuild -project mParticle-Optimizely.xcodeproj -scheme mParticle_OptimizelyTests -destination 'platform=iOS Simulator,OS=12.0,name=iPhone XS' test

Cartfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github "optimizely/objective-c-sdk" ~> 2.1.3
2+
github "mparticle/mparticle-apple-sdk" ~> 7.7.0

Cartfile.private

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "erikdoe/ocmock" ~> 3.4.3

mParticle-Optimizely.podspec

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Pod::Spec.new do |s|
2+
s.name = "mParticle-Optimizely"
3+
s.version = "7.6.0"
4+
s.summary = "Optimizely integration for mParticle"
5+
6+
s.description = <<-DESC
7+
This is the Optimizely integration for mParticle.
8+
DESC
9+
10+
s.homepage = "https://www.mparticle.com"
11+
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
12+
s.author = { "mParticle" => "[email protected]" }
13+
s.source = { :git => "https://github.com/mparticle-integrations/mparticle-apple-integration-optimizely.git", :tag => s.version.to_s }
14+
s.social_media_url = "https://twitter.com/mparticles"
15+
16+
s.ios.deployment_target = "8.0"
17+
s.ios.source_files = 'mParticle_Optimizely/*.{h,m,mm}'
18+
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 7.7.3'
19+
s.ios.frameworks = 'CoreTelephony', 'SystemConfiguration'
20+
s.libraries = 'z'
21+
s.ios.dependency 'OptimizelySDKiOS', '~> 2.1.3'
22+
23+
s.tvos.deployment_target = "9.0"
24+
s.tvos.source_files = 'mParticle_Optimizely/*.{h,m,mm}'
25+
s.tvos.dependency 'mParticle-Apple-SDK/mParticle', '~> 7.7.3'
26+
s.tvos.frameworks = 'SystemConfiguration'
27+
s.tvos.dependency 'OptimizelySDKTVOS', '~> 2.1.3'
28+
29+
s.tvos.pod_target_xcconfig = {
30+
'LIBRARY_SEARCH_PATHS' => '$(inherited) $(PODS_ROOT)/OptimizelySDKTVOS/**'
31+
}
32+
end

mParticle_Optimizely.xcodeproj/project.pbxproj

Lines changed: 802 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0940"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "D316BD31217F670500688E56"
18+
BuildableName = "mParticle_Optimizely.framework"
19+
BlueprintName = "mParticle_Optimizely"
20+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "D316BD3A217F670600688E56"
36+
BuildableName = "mParticle_OptimizelyTests.xctest"
37+
BlueprintName = "mParticle_OptimizelyTests"
38+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "D316BD31217F670500688E56"
46+
BuildableName = "mParticle_Optimizely.framework"
47+
BlueprintName = "mParticle_Optimizely"
48+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "D316BD31217F670500688E56"
68+
BuildableName = "mParticle_Optimizely.framework"
69+
BlueprintName = "mParticle_Optimizely"
70+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "D316BD31217F670500688E56"
86+
BuildableName = "mParticle_Optimizely.framework"
87+
BlueprintName = "mParticle_Optimizely"
88+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0940"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "D308517D219B2CEC00D1C15A"
18+
BuildableName = "mParticle_Optimizely_tvOS.framework"
19+
BlueprintName = "mParticle_Optimizely_tvOS"
20+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "D3085185219B2CEC00D1C15A"
36+
BuildableName = "mParticle_Optimizely_tvOSTests.xctest"
37+
BlueprintName = "mParticle_Optimizely_tvOSTests"
38+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "D308517D219B2CEC00D1C15A"
46+
BuildableName = "mParticle_Optimizely_tvOS.framework"
47+
BlueprintName = "mParticle_Optimizely_tvOS"
48+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "D308517D219B2CEC00D1C15A"
68+
BuildableName = "mParticle_Optimizely_tvOS.framework"
69+
BlueprintName = "mParticle_Optimizely_tvOS"
70+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "D308517D219B2CEC00D1C15A"
86+
BuildableName = "mParticle_Optimizely_tvOS.framework"
87+
BlueprintName = "mParticle_Optimizely_tvOS"
88+
ReferencedContainer = "container:mParticle_Optimizely.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>

mParticle_Optimizely/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSPrincipalClass</key>
22+
<string></string>
23+
</dict>
24+
</plist>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// MPKitOptimizely.h
3+
//
4+
// Copyright 2018 mParticle, Inc.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
#import <Foundation/Foundation.h>
20+
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle.h>)
21+
#import <mParticle_Apple_SDK/mParticle.h>
22+
#else
23+
#import "mParticle.h"
24+
#endif
25+
26+
extern NSString * _Nonnull const optimizelyCustomEventName;
27+
extern NSString * _Nonnull const optimizelyTrackedValue;
28+
extern NSString * _Nonnull const optimizelyCustomUserId;
29+
30+
@class OPTLYClient;
31+
@class OPTLYVariation;
32+
33+
extern NSString *const MPKitOptimizelyEventName;
34+
extern NSString *const MPKitOptimizelyEventKeyValue;
35+
36+
@interface MPKitOptimizely : NSObject <MPKitProtocol>
37+
38+
@property (nonatomic, strong, nonnull) NSDictionary *configuration;
39+
@property (nonatomic, strong, nullable) NSDictionary *launchOptions;
40+
@property (nonatomic, unsafe_unretained, readonly) BOOL started;
41+
@property (nonatomic, strong, nullable) MPKitAPI *kitApi;
42+
43+
- (OPTLYVariation *)variationForExperimentKey:(nonnull NSString *)key customUserId:(nullable NSString *)customUserID;
44+
+ (OPTLYClient *)optimizelyClient;
45+
+ (void)setOptimizelyClient:(OPTLYClient *)client;
46+
@end

0 commit comments

Comments
 (0)