Skip to content

Commit 25f1144

Browse files
authored
feat: Port ga4 commits to google analytics firebase (#22)
1 parent 3abdb5a commit 25f1144

File tree

9 files changed

+626
-361
lines changed

9 files changed

+626
-361
lines changed

Package.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "mParticle-Google-Analytics-Firebase",
8+
platforms: [ .iOS(.v11) ],
9+
products: [
10+
.library(
11+
name: "mParticle-Google-Analytics-Firebase",
12+
targets: ["mParticle-Google-Analytics-Firebase"]),
13+
],
14+
dependencies: [
15+
.package(name: "mParticle-Apple-SDK",
16+
url: "https://github.com/mParticle/mparticle-apple-sdk",
17+
.upToNextMajor(from: "8.0.0")),
18+
.package(name: "Firebase",
19+
url: "https://github.com/firebase/firebase-ios-sdk.git",
20+
.upToNextMajor(from: "9.0.0")),
21+
],
22+
targets: [
23+
.target(
24+
name: "mParticle-Google-Analytics-Firebase",
25+
dependencies: [
26+
.byName(name: "mParticle-Apple-SDK"),
27+
.product(name: "FirebaseAnalytics", package: "Firebase"),
28+
],
29+
path: "mParticle-Google-Analytics-Firebase",
30+
exclude: ["Info.plist"],
31+
publicHeadersPath: "."),
32+
]
33+
)

mParticle-Google-Analytics-Firebase.xcodeproj/project.pbxproj

Lines changed: 142 additions & 102 deletions
Large diffs are not rendered by default.

mParticle-Google-Analytics-Firebase.xcodeproj/xcshareddata/xcschemes/mParticle-Google-Analytics-Firebase.xcscheme

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,27 @@
2020
ReferencedContainer = "container:mParticle-Google-Analytics-Firebase.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "NO"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "NO">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "D3C7855121FF6CEB00FE47D2"
32+
BuildableName = "mParticle-Google-Analytics-FirebaseTests.xctest"
33+
BlueprintName = "mParticle-Google-Analytics-FirebaseTests"
34+
ReferencedContainer = "container:mParticle-Google-Analytics-Firebase.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
2337
</BuildActionEntries>
2438
</BuildAction>
2539
<TestAction
2640
buildConfiguration = "Debug"
2741
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2842
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2943
shouldUseLaunchSchemeArgsEnv = "YES">
30-
<MacroExpansion>
31-
<BuildableReference
32-
BuildableIdentifier = "primary"
33-
BlueprintIdentifier = "D316BD31217F670500688E56"
34-
BuildableName = "mParticle_Google_Analytics_Firebase.framework"
35-
BlueprintName = "mParticle-Google-Analytics-Firebase"
36-
ReferencedContainer = "container:mParticle-Google-Analytics-Firebase.xcodeproj">
37-
</BuildableReference>
38-
</MacroExpansion>
3944
<Testables>
4045
<TestableReference
4146
skipped = "NO">
@@ -59,15 +64,6 @@
5964
debugDocumentVersioning = "YES"
6065
debugServiceExtension = "internal"
6166
allowLocationSimulation = "YES">
62-
<MacroExpansion>
63-
<BuildableReference
64-
BuildableIdentifier = "primary"
65-
BlueprintIdentifier = "D316BD31217F670500688E56"
66-
BuildableName = "mParticle_Google_Analytics_Firebase.framework"
67-
BlueprintName = "mParticle-Google-Analytics-Firebase"
68-
ReferencedContainer = "container:mParticle-Google-Analytics-Firebase.xcodeproj">
69-
</BuildableReference>
70-
</MacroExpansion>
7167
</LaunchAction>
7268
<ProfileAction
7369
buildConfiguration = "Release"

mParticle-Google-Analytics-Firebase/MPKitFirebaseAnalytics.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
#else
55
#import "mParticle.h"
66
#endif
7-
#if SWIFT_PACKAGE
8-
@import Firebase;
9-
#else
10-
#if __has_include(<FirebaseCore/FirebaseCore.h>)
11-
#import <FirebaseCore/FirebaseCore.h>
12-
#import <FirebaseAnalytics/FIRAnalytics.h>
13-
#else
14-
#import "FirebaseCore/FirebaseCore.h"
15-
#import "FirebaseAnalytics/FIRAnalytics.h"
16-
#endif
17-
#endif
187

198
@interface MPKitFirebaseAnalytics : NSObject <MPKitProtocol>
209

@@ -29,4 +18,9 @@ static NSString * _Nonnull const kMPFIRGoogleAppIDKey = @"firebaseAppId";
2918
static NSString * _Nonnull const kMPFIRSenderIDKey = @"googleProjectNumber";
3019
static NSString * _Nonnull const kMPFIRAPIKey = @"firebaseAPIKey";
3120
static NSString * _Nonnull const kMPFIRProjectIDKey = @"firebaseProjectId";
32-
static NSString * _Nonnull const kMPFIRUserIdFieldKey = @"userIdField";
21+
static NSString * _Nonnull const kMPFIRExternalUserIdentityType = @"userIdField";
22+
static NSString * _Nonnull const kMPFIRShouldHashUserId = @"hashUserId";
23+
static NSString * _Nonnull const kMPFIRForwardRequestsServerSide = @"forwardWebRequestsServerSide";
24+
static NSString * _Nonnull const kMPFIRCommerceEventType = @"Firebase.CommerceEventType";
25+
static NSString * _Nonnull const kMPFIRPaymentType = @"Firebase.PaymentType";
26+
static NSString * _Nonnull const kMPFIRShippingTier = @"Firebase.ShippingTier";

0 commit comments

Comments
 (0)