Skip to content

Commit

Permalink
Added AppsFlyer
Browse files Browse the repository at this point in the history
Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed Dec 12, 2024
1 parent ee373aa commit fe54ba0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 10 deletions.
37 changes: 27 additions & 10 deletions litewallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
C30029E225D0185500F08C2B /* StandardDividerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30029E125D0185500F08C2B /* StandardDividerView.swift */; };
C30029EB25D019BC00F08C2B /* CopyButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30029EA25D019BC00F08C2B /* CopyButtonView.swift */; };
C3019EE32B8FEFED00FAF648 /* AssociatedObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3019EE22B8FEFED00FAF648 /* AssociatedObject.swift */; };
C30808A22D0A19E60063E793 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C30808A12D0A19E60063E793 /* GoogleService-Info.plist */; };
C30808A52D0A23530063E793 /* AppsFlyerLib-Static in Frameworks */ = {isa = PBXBuildFile; productRef = C30808A42D0A23530063E793 /* AppsFlyerLib-Static */; };
C316CF49261887FC00E4C09B /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C316CF48261887FC00E4C09B /* UIApplication+Extension.swift */; };
C31891C326733FD400ECE25C /* TabBarViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31891C226733FD400ECE25C /* TabBarViewControllerTests.swift */; };
C32142EA25C97CD900BECCD0 /* TransactionCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C32142E925C97CD900BECCD0 /* TransactionCellView.swift */; };
Expand Down Expand Up @@ -287,7 +289,6 @@
C36DBF5F28F18D2C00FBCB24 /* LocalWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36DBF5E28F18D2C00FBCB24 /* LocalWebView.swift */; };
C36DBF6128F1988900FBCB24 /* LocalWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36DBF6028F1988900FBCB24 /* LocalWebViewModel.swift */; };
C37D51572CFBB5DB003E206E /* Debug-GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C37D51562CFBB5DB003E206E /* Debug-GoogleService-Info.plist */; };
C37D51592CFBB5E4003E206E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C37D51582CFBB5E4003E206E /* GoogleService-Info.plist */; };
C39443F9269DDAD3002703E9 /* LitewalletIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39443F8269DDAD3002703E9 /* LitewalletIconView.swift */; };
C39A71472608CB4300E7B640 /* EmptyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39A71462608CB4300E7B640 /* EmptyTableViewCell.swift */; };
C3B419CB2BFCF14100EBD935 /* BuyHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B419CA2BFCF14100EBD935 /* BuyHostingController.swift */; };
Expand Down Expand Up @@ -1386,6 +1387,7 @@
C30029E125D0185500F08C2B /* StandardDividerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardDividerView.swift; sourceTree = "<group>"; };
C30029EA25D019BC00F08C2B /* CopyButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyButtonView.swift; sourceTree = "<group>"; };
C3019EE22B8FEFED00FAF648 /* AssociatedObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociatedObject.swift; sourceTree = "<group>"; };
C30808A12D0A19E60063E793 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
C31045602CDBB94600C11FDE /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
C316CF48261887FC00E4C09B /* UIApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = "<group>"; };
C31891C226733FD400ECE25C /* TabBarViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarViewControllerTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1435,7 +1437,6 @@
C36DBF5E28F18D2C00FBCB24 /* LocalWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebView.swift; sourceTree = "<group>"; };
C36DBF6028F1988900FBCB24 /* LocalWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebViewModel.swift; sourceTree = "<group>"; };
C37D51562CFBB5DB003E206E /* Debug-GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Debug-GoogleService-Info.plist"; sourceTree = "<group>"; };
C37D51582CFBB5E4003E206E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
C39443F8269DDAD3002703E9 /* LitewalletIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LitewalletIconView.swift; sourceTree = "<group>"; };
C39A71462608CB4300E7B640 /* EmptyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyTableViewCell.swift; sourceTree = "<group>"; };
C3ACF2DE25DED601008671D4 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1660,6 +1661,7 @@
22A9A9641DF61FE7000F0016 /* Security.framework in Frameworks */,
22A9A9621DF61FE0000F0016 /* SystemConfiguration.framework in Frameworks */,
22A9A9601DF61FD8000F0016 /* CoreLocation.framework in Frameworks */,
C30808A52D0A23530063E793 /* AppsFlyerLib-Static in Frameworks */,
22A9A95E1DF61FD0000F0016 /* PushKit.framework in Frameworks */,
C3423C182B781C6B0051BD6D /* PushNotifications in Frameworks */,
C35C1222293D464A0009022D /* FirebaseAuth in Frameworks */,
Expand Down Expand Up @@ -2977,7 +2979,7 @@
isa = PBXGroup;
children = (
C7FD407E2C48FAF60010C0E6 /* partner-keys.plist */,
C37D51582CFBB5E4003E206E /* GoogleService-Info.plist */,
C30808A12D0A19E60063E793 /* GoogleService-Info.plist */,
C37D51562CFBB5DB003E206E /* Debug-GoogleService-Info.plist */,
);
name = LaunchDataResources;
Expand Down Expand Up @@ -3564,6 +3566,7 @@
C35C1223293D464A0009022D /* FirebaseCrashlytics */,
C35C1229293D48340009022D /* KeychainAccess */,
C3423C172B781C6B0051BD6D /* PushNotifications */,
C30808A42D0A23530063E793 /* AppsFlyerLib-Static */,
);
productName = breadwallet;
productReference = 75A2A7901DA5934300A983D8 /* Litewallet.app */;
Expand Down Expand Up @@ -3693,6 +3696,7 @@
C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
C35C1228293D48330009022D /* XCRemoteSwiftPackageReference "KeychainAccess" */,
C3423C162B7816EA0051BD6D /* XCRemoteSwiftPackageReference "push-notifications-swift" */,
C30808A32D0A23530063E793 /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Static" */,
);
productRefGroup = 75A2A7911DA5934300A983D8 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -3723,7 +3727,7 @@
files = (
C3423C492B796D820051BD6D /* Ko.mp3 in Resources */,
75A2A79E1DA5934300A983D8 /* LaunchScreen.storyboard in Resources */,
C37D51592CFBB5E4003E206E /* GoogleService-Info.plist in Resources */,
C30808A22D0A19E60063E793 /* GoogleService-Info.plist in Resources */,
C33685092BECE8B10069CBC7 /* PrivacyInfo.xcprivacy in Resources */,
C3423C3F2B796D820051BD6D /* Pt.mp3 in Resources */,
24D5F23822599C0B00225462 /* BarlowSemiCondensed-Italic.ttf in Resources */,
Expand Down Expand Up @@ -4496,7 +4500,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240527.6;
CURRENT_PROJECT_VERSION = 241211.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
Expand All @@ -4513,7 +4517,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.5;
MARKETING_VERSION = 3.14.0;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "-DDebug $(inherited)";
Expand Down Expand Up @@ -4854,7 +4858,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240527.6;
CURRENT_PROJECT_VERSION = 241211.0;
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -4870,7 +4874,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.5;
MARKETING_VERSION = 3.14.0;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down Expand Up @@ -4996,7 +5000,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240527.6;
CURRENT_PROJECT_VERSION = 241211.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = NO;
Expand All @@ -5013,7 +5017,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.5;
MARKETING_VERSION = 3.14.0;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "-DDebug -DTestnet $(inherited)";
Expand Down Expand Up @@ -5197,6 +5201,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
C30808A32D0A23530063E793 /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Static" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/AppsFlyerSDK/AppsFlyerFramework-Static";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.15.3;
};
};
C3423C162B7816EA0051BD6D /* XCRemoteSwiftPackageReference "push-notifications-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/pusher/push-notifications-swift.git";
Expand Down Expand Up @@ -5224,6 +5236,11 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
C30808A42D0A23530063E793 /* AppsFlyerLib-Static */ = {
isa = XCSwiftPackageProductDependency;
package = C30808A32D0A23530063E793 /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Static" */;
productName = "AppsFlyerLib-Static";
};
C3423C172B781C6B0051BD6D /* PushNotifications */ = {
isa = XCSwiftPackageProductDependency;
package = C3423C162B7816EA0051BD6D /* XCRemoteSwiftPackageReference "push-notifications-swift" */;
Expand Down
6 changes: 6 additions & 0 deletions litewallet/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import AppsFlyerLib
import Firebase
import LocalAuthentication
import PushNotifications
Expand Down Expand Up @@ -28,6 +29,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Firebase
self.setFirebaseConfiguration()

// AF
AppsFlyerLib.shared().appsFlyerDevKey = Partner.partnerKeyPath(name: .devAF)
AppsFlyerLib.shared().appleAppID = "1119332592"

// Pusher
self.pushNotifications.start(instanceId: Partner.partnerKeyPath(name: .pusher))
let generalInterest = String.preferredLanguageInterest(currentId: UserDefaults.selectedLanguage)
Expand Down Expand Up @@ -87,6 +92,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func applicationDidBecomeActive(_: UIApplication) {
UIApplication.shared.applicationIconBadgeNumber = 0
AppsFlyerLib.shared().start()
}

func applicationWillEnterForeground(_: UIApplication) {
Expand Down
24 changes: 24 additions & 0 deletions litewallet/PartnerData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ enum PartnerName {
case litewalletOps
case litewalletStart
case pusher
case devAF
case prodAF
}

struct Partner {
Expand Down Expand Up @@ -89,6 +91,28 @@ struct Partner {
LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription])
return errorDescription
}
case .devAF:

if let dictionary = NSDictionary(contentsOfFile: filePath) as? [String: AnyObject],
let key = dictionary["af-dev-id"] as? String
{
return key
} else {
let errorDescription = "error_afdev_id_key"
LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription])
return errorDescription
}
case .prodAF:

if let dictionary = NSDictionary(contentsOfFile: filePath) as? [String: AnyObject],
let key = dictionary["af-prod-id"] as? String
{
return key
} else {
let errorDescription = "error_afprod_id_key"
LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription])
return errorDescription
}
}
}

Expand Down

0 comments on commit fe54ba0

Please sign in to comment.