Skip to content

Commit

Permalink
GoogleAnalytics / Firebase update
Browse files Browse the repository at this point in the history
  • Loading branch information
Skornos committed Aug 6, 2018
1 parent 6d80c9f commit e12c16e
Show file tree
Hide file tree
Showing 275 changed files with 19,141 additions and 8,754 deletions.
8 changes: 4 additions & 4 deletions OpenShop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
AD79BEF61C7EEAC800D128AF /* BFBranchOpeningHours.m in Sources */ = {isa = PBXBuildFile; fileRef = AD79BEF41C7EEAC800D128AF /* BFBranchOpeningHours.m */; };
AD79BEF91C7EF25C00D128AF /* NSArray+Map.m in Sources */ = {isa = PBXBuildFile; fileRef = AD79BEF81C7EF25C00D128AF /* NSArray+Map.m */; };
AD7AD0C81C74737D00B14C89 /* BFEditCartProductTableViewCellExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = AD7AD0C71C74737D00B14C89 /* BFEditCartProductTableViewCellExtension.m */; };
AD88A106211824630001C20B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AD88A105211824630001C20B /* GoogleService-Info.plist */; };
AD9BA5D81C88201000221C82 /* XCUIElement+ForceTap.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9BA5D71C88201000221C82 /* XCUIElement+ForceTap.swift */; };
AD9BA5DE1C887AB100221C82 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AD9BA5DA1C887A8A00221C82 /* Roboto-Bold.ttf */; };
AD9BA5DF1C887AB100221C82 /* Roboto-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AD9BA5DB1C887A8A00221C82 /* Roboto-Light.ttf */; };
Expand Down Expand Up @@ -190,7 +191,6 @@
ADF26D831C4D12500020777B /* BFOrderFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ADF26D821C4D12500020777B /* BFOrderFormViewController.m */; };
ADF26D871C4D26620020777B /* BFOrderFormShippingPaymentTableViewCellExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = ADF26D861C4D26620020777B /* BFOrderFormShippingPaymentTableViewCellExtension.m */; };
ADF627841C60D59B00A10A2B /* BFDataResponseCartInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = ADF627831C60D59B00A10A2B /* BFDataResponseCartInfo.m */; };
ADF7CBEA1D490926003CAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = ADF7CBE91D490926003CAE09 /* GoogleService-Info.plist */; };
ADF7CBED1D4909C2003CAE09 /* BFGoogleService.m in Sources */ = {isa = PBXBuildFile; fileRef = ADF7CBEC1D4909C2003CAE09 /* BFGoogleService.m */; };
ADF7CBEE1D490C7E003CAE09 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD305C891B1CA9780059B7F9 /* CoreData.framework */; };
ADFA0D391C4E7A19002771A1 /* BFAddressTableViewCellExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = ADFA0D381C4E7A19002771A1 /* BFAddressTableViewCellExtension.m */; };
Expand Down Expand Up @@ -611,6 +611,7 @@
AD79BEF81C7EF25C00D128AF /* NSArray+Map.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Map.m"; sourceTree = "<group>"; };
AD7AD0C61C74737D00B14C89 /* BFEditCartProductTableViewCellExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFEditCartProductTableViewCellExtension.h; sourceTree = "<group>"; };
AD7AD0C71C74737D00B14C89 /* BFEditCartProductTableViewCellExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFEditCartProductTableViewCellExtension.m; sourceTree = "<group>"; };
AD88A105211824630001C20B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
AD9927A258E418DB290A39F5 /* libPods-OpenShopUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OpenShopUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AD9BA5D71C88201000221C82 /* XCUIElement+ForceTap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCUIElement+ForceTap.swift"; sourceTree = "<group>"; };
AD9BA5DA1C887A8A00221C82 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Bold.ttf"; path = "Fonts/Roboto-Bold.ttf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -669,7 +670,6 @@
ADF26D861C4D26620020777B /* BFOrderFormShippingPaymentTableViewCellExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFOrderFormShippingPaymentTableViewCellExtension.m; sourceTree = "<group>"; };
ADF627821C60D59B00A10A2B /* BFDataResponseCartInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BFDataResponseCartInfo.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
ADF627831C60D59B00A10A2B /* BFDataResponseCartInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BFDataResponseCartInfo.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
ADF7CBE91D490926003CAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
ADF7CBEB1D4909C2003CAE09 /* BFGoogleService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFGoogleService.h; sourceTree = "<group>"; };
ADF7CBEC1D4909C2003CAE09 /* BFGoogleService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFGoogleService.m; sourceTree = "<group>"; };
ADF7CBEF1D490CAA003CAE09 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -1394,7 +1394,7 @@
72DDF75E16E7485F00887646 /* Supporting Files */ = {
isa = PBXGroup;
children = (
ADF7CBE91D490926003CAE09 /* GoogleService-Info.plist */,
AD88A105211824630001C20B /* GoogleService-Info.plist */,
72DDF75F16E7485F00887646 /* Info.plist */,
72DDF76316E7485F00887646 /* main.m */,
72DDF76516E7485F00887646 /* Prefix.pch */,
Expand Down Expand Up @@ -2005,11 +2005,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
ADF7CBEA1D490926003CAE09 /* GoogleService-Info.plist in Resources */,
AD9BA5DE1C887AB100221C82 /* Roboto-Bold.ttf in Resources */,
AD9BA5DF1C887AB100221C82 /* Roboto-Light.ttf in Resources */,
AD9BA5E01C887AB100221C82 /* Roboto-Medium.ttf in Resources */,
AD9BA5E11C887AB100221C82 /* Roboto-Regular.ttf in Resources */,
AD88A106211824630001C20B /* GoogleService-Info.plist in Resources */,
7253B0D11769C4AC004C6554 /* Localizable.strings in Resources */,
BBBDC1B01C4298D500B629A4 /* BFLoadingCollectionReusableView.xib in Resources */,
A1D4C13F1817D70C0093ED50 /* Images.xcassets in Resources */,
Expand Down
23 changes: 11 additions & 12 deletions OpenShop/BFAnalyticsGoogle.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#import "BFAnalyticsGoogle.h"
#import "BFProduct.h"
#import <Google/Analytics.h>

@import Firebase;

static NSString * const trackerName = @"foo";
static NSString * const trackerUA = @"UA-73690730-2";
Expand All @@ -17,17 +18,15 @@ @implementation BFAnalyticsGoogle

+ (void)logPurchasedProduct:(BFProduct *)product amount:(NSNumber *)amount quantity:(NSNumber *)quantity category:(NSString *)category sku:(NSString *)sku transactionId:(NSString *)transactionId
{
id tracker = [[GAI sharedInstance] trackerWithName:trackerName trackingId:trackerUA];
// Enable IDFA collection.
[tracker setAllowIDFACollection:YES];
[tracker send:[[GAIDictionaryBuilder createItemWithTransactionId:transactionId // (NSString) Transaction ID
name:product.name // (NSString) Product Name
sku:sku // (NSString) Product SKU
category:category // (NSString) Product category
price:product.price // (NSNumber) Product price
quantity:quantity // (NSInteger) Product quantity
currencyCode:product.currency] // (NSString) Currency code
build]];
[FIRAnalytics logEventWithName:kFIREventEcommercePurchase
parameters:@{
kFIRParameterItemID:transactionId,
kFIRParameterItemName:product.name,
kFIRParameterItemCategory:category,
kFIRParameterPrice:product.price,
kFIRParameterQuantity:quantity,
kFIRParameterCurrency:product.currency
}];
}

@end
19 changes: 5 additions & 14 deletions OpenShop/BFGoogleService.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@
// Copyright © 2016 Business-Factory. All rights reserved.
//

@import Firebase;

#import "BFGoogleService.h"
#import <Google/Analytics.h>

@implementation BFGoogleService

/**
* Configure GGLContext.
*/
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);

GAI *gai = [GAI sharedInstance];

// Optional: configure GAI options.
gai.trackUncaughtExceptions = YES; // report uncaught exceptions
gai.logger.logLevel = kGAILogLevelError;

// Enable the following line once you add GoogleService-Info.plist from your Firebase console
[FIRApp configure];

return YES;
}
Expand Down
32 changes: 23 additions & 9 deletions OpenShop/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,39 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TRACKING_ID</key>
<string>UA-73690730-2</string>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>CLIENT_ID</key>
<string>1076308558600-1a6mltream44774ebr99rp0nmc7fkuig.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1076308558600-1a6mltream44774ebr99rp0nmc7fkuig</string>
<key>API_KEY</key>
<string>AIzaSyADFYnpG4RYd2aKgnnI1D6qgKQPMEvyFGs</string>
<key>GCM_SENDER_ID</key>
<string>1076308558600</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>businessfactory.openshop</string>
<key>PROJECT_ID</key>
<string>firebase-openshop</string>
<string>api-project-1076308558600</string>
<key>STORAGE_BUCKET</key>
<string>api-project-1076308558600.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false/>
<true></true>
<key>IS_ANALYTICS_ENABLED</key>
<true/>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<false></false>
<key>IS_GCM_ENABLED</key>
<false/>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<false/>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:826319430675:ios:73f1fac2d91df633</string>
<string>1:1076308558600:ios:73f1fac2d91df633</string>
<key>DATABASE_URL</key>
<string>https://api-project-1076308558600.firebaseio.com</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion OpenShop/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>4</string>
<key>FacebookAppID</key>
<string>1686631971595434</string>
<key>FacebookDisplayName</key>
Expand Down
Loading

0 comments on commit e12c16e

Please sign in to comment.