Skip to content

Commit

Permalink
change Privacy manifest
Browse files Browse the repository at this point in the history
- Debugging the Transaction and the pusher
- fixed conflict
- revert partner data reference
- updated tags
- added push shutdown when user denied pushes
- analytics note
- bump version

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed May 11, 2024
1 parent cc87a7d commit 7adb26c
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 43 deletions.
8 changes: 1 addition & 7 deletions PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains
NSPrivacyTrackingDomains
</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
Expand Down Expand Up @@ -93,13 +89,11 @@ NSPrivacyTrackingDomains
</array>
</dict>
</array>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string></string>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
Expand Down
16 changes: 8 additions & 8 deletions litewallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@
C3FDADED28B2DB090054FC80 /* SendAddressHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FDADEC28B2DB090054FC80 /* SendAddressHostingController.swift */; };
C3FF4D5F28AC5A5800713139 /* SendAddressCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FF4D5E28AC5A5800713139 /* SendAddressCellView.swift */; };
C3FF4D6128AC5AC100713139 /* SendAddressCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FF4D6028AC5AC100713139 /* SendAddressCellViewModel.swift */; };
C738969F2BEA3C0200029095 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C738969E2BEA3C0200029095 /* GoogleService-Info.plist */; };
C73896A12BEA3C4900029095 /* partner-keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = C73896A02BEA3C4900029095 /* partner-keys.plist */; };
C738969F2BEA3C0200029095 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C738969E2BEA3C0200029095 /* GoogleService-Info.plist */; settings = {ASSET_TAGS = ("initial-resources", ); }; };
C73896A12BEA3C4900029095 /* partner-keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = C73896A02BEA3C4900029095 /* partner-keys.plist */; settings = {ASSET_TAGS = ("initial-resources", ); }; };
CE03EC741EF256AC0038E3A8 /* SimpleUTXO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE03EC731EF256AC0038E3A8 /* SimpleUTXO.swift */; };
CE0CD1591DBFBCF5004023DA /* ModalPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CD1581DBFBCF5004023DA /* ModalPresenter.swift */; };
CE124CF81E67A8E500DFA146 /* TransactionDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE124CF71E67A8E500DFA146 /* TransactionDirection.swift */; };
Expand Down Expand Up @@ -4534,7 +4534,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240509.1;
CURRENT_PROJECT_VERSION = 240510.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
Expand All @@ -4550,7 +4550,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.3;
MARKETING_VERSION = 3.13.4;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "-DDebug $(inherited)";
Expand Down Expand Up @@ -4891,7 +4891,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240509.1;
CURRENT_PROJECT_VERSION = 240510.0;
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -4906,7 +4906,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.3;
MARKETING_VERSION = 3.13.4;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down Expand Up @@ -5032,7 +5032,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240509.1;
CURRENT_PROJECT_VERSION = 240510.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = NO;
Expand All @@ -5048,7 +5048,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.13.3;
MARKETING_VERSION = 3.13.4;
ONLY_ACTIVE_ARCH = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "initial-resources speakTag";
OTHER_SWIFT_FLAGS = "-DDebug -DTestnet $(inherited)";
Expand Down
36 changes: 29 additions & 7 deletions litewallet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
requestResourceWith(tag: ["initial-resources", "speakTag"]) { [self] in

// Language
updateCurrentUserLocale(localeId: Locale.current.identifier)
Bundle.setLanguage(UserDefaults.selectedLanguage)

// Ops
let startDate = Partner.partnerKeyPath(name: .litewalletStart)
if startDate == "error-litewallet-start-key" {
Expand All @@ -24,14 +29,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
self.setFirebaseConfiguration()

// Pusher
self.pushNotifications.start(instanceId: Partner.partnerKeyPath(name: .pusherStaging))
let generaliOSInterest = "general-ios"
let debugGeneraliOSInterest = "debug-general-ios"
self.pushNotifications.start(instanceId: Partner.partnerKeyPath(name: .pusher))
let generalInterest = String.preferredLanguageInterest(currentId: UserDefaults.selectedLanguage)
let debugGeneralInterest = "debug-general"

try? self.pushNotifications.clearDeviceInterests()

try? self.pushNotifications
.addDeviceInterest(interest: generaliOSInterest)
.addDeviceInterest(interest: generalInterest)
try? self.pushNotifications
.addDeviceInterest(interest: debugGeneraliOSInterest)
.addDeviceInterest(interest: debugGeneralInterest)

let interests = self.pushNotifications.getDeviceInterests()?.joined(separator: "|") ?? ""
let device = UIDevice.current.identifierForVendor?.uuidString ?? "ID"
Expand All @@ -40,6 +47,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

LWAnalytics.logEventWithParameters(itemName: ._20231202_RIGI,
properties: interestsDict)

let current = UNUserNotificationCenter.current()

current.getNotificationSettings(completionHandler: { settings in

debugPrint(settings.debugDescription)
if settings.authorizationStatus == .denied {
self.pushNotifications.clearAllState {
LWAnalytics.logEventWithParameters(itemName: ._20240506_DPN)
}

self.pushNotifications.stop {
LWAnalytics.logEventWithParameters(itemName: ._20240510_SPN)
}
}
})

} onFailure: { error in

let properties: [String: String] = ["error_type": "on_demand_resources_not_found",
Expand All @@ -58,8 +82,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

LWAnalytics.logEventWithParameters(itemName: ._20191105_AL)

Bundle.setLanguage(UserDefaults.selectedLanguage)

return true
}

Expand Down
6 changes: 3 additions & 3 deletions litewallet/ApplicationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ApplicationController: Subscriber, Trackable {
}
exchangeUpdater?.refresh(completion: {})
feeUpdater?.refresh()
walletManager.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
// walletManager.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
if modalPresenter?.walletManager == nil {
modalPresenter?.walletManager = walletManager
}
Expand All @@ -127,7 +127,7 @@ class ApplicationController: Subscriber, Trackable {
}
exchangeUpdater?.refresh(completion: {})
feeUpdater?.refresh()
walletManager.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
// walletManager.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
if modalPresenter?.walletManager == nil {
modalPresenter?.walletManager = walletManager
}
Expand All @@ -143,7 +143,7 @@ class ApplicationController: Subscriber, Trackable {
if !store.state.isLoginRequired {
UserDefaults.standard.set(Date().timeIntervalSince1970, forKey: timeSinceLastExitKey)
}
walletManager?.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
// walletManager?.apiClient?.kv?.syncAllKeys { print("KV finished syncing. err: \(String(describing: $0))") }
}

func performFetch(_ completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Expand Down
12 changes: 10 additions & 2 deletions litewallet/BundleExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ public extension Bundle {
object_setClass(Bundle.main, BundleEx.self as AnyClass)
}

if let temp = language {
guard let bundle = Bundle(path: Bundle.main.path(forResource: temp, ofType: "lproj")!) else {
if var temp = language {
if temp == "zh" {
temp = "zh-Hans"
}

guard let path = Bundle.main.path(forResource: temp, ofType: "lproj") else {
LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR)
return
}
guard let bundle = Bundle(path: path) else {
LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR)
return
}
Expand Down
6 changes: 6 additions & 0 deletions litewallet/Constants/Constants+Events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,10 @@ enum CustomEvent: String {

/// Transactions info
case _20240315_AI = "application_info"

/// Disabled Push Notifications
case _20240506_DPN = "disabled_push_notifications"

/// Stop Push Notifications
case _20240510_SPN = "stopped_push_notifications"
}
13 changes: 0 additions & 13 deletions litewallet/PartnerData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ enum PartnerName {
case litewalletOps
case litewalletStart
case pusher
case pusherStaging
}

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

case .pusherStaging:

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

Expand Down
1 change: 0 additions & 1 deletion litewallet/ViewControllers/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ class LoginViewController: UIViewController, Subscriber, Trackable {
if let disabledUntil = walletManager?.walletDisabledUntil {
let now = Date().timeIntervalSince1970
if disabledUntil > now {
saveEvent("login.locked")
let disabledUntilDate = Date(timeIntervalSince1970: disabledUntil)
let unlockInterval = disabledUntil - now
let df = DateFormatter()
Expand Down
2 changes: 0 additions & 2 deletions litewallet/WalletCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class WalletCoordinator: Subscriber, Trackable {

return transactions.compactMap { $0 }.sorted {
$0.pointee.timestamp > $1.pointee.timestamp
}.compactMap {
Transaction($0, walletManager: walletManager, kvStore: kvStore, rate: rate)
}
.compactMap {
Transaction($0, walletManager: walletManager, kvStore: kvStore, rate: rate)
Expand Down

0 comments on commit 7adb26c

Please sign in to comment.