Add Branch SDK integration

pull/2/head
Michael Scoff 7 years ago
parent be99d94e46
commit 7a3ef289c3
  1. 1
      Podfile
  2. 7
      Podfile.lock
  3. 2
      Trust.xcodeproj/project.pbxproj
  4. 28
      Trust/AppDelegate.swift
  5. 7
      Trust/Info.plist
  6. 5
      Trust/Trust.entitlements
  7. 2
      Trust/Wallet/ViewModels/EnterPasswordViewModel.swift

@ -26,6 +26,7 @@ target 'Trust' do
pod 'Crashlytics'
pod 'Kingfisher', '~> 4.0'
pod 'TrustKeystore', :git=>'https://github.com/TrustWallet/trust-keystore', :branch=>'master'
pod 'Branch'
# pod 'web3swift', :git=>'https://github.com/BANKEX/web3swift', :branch=>'master'
pod 'SAMKeychain'

@ -5,6 +5,9 @@ PODS:
- BigInt (3.0.1):
- SipHash (~> 1.2)
- BonMot (5.0)
- Branch (0.22.5):
- Branch/Core (= 0.22.5)
- Branch/Core (0.22.5)
- Crashlytics (3.9.3):
- Fabric (~> 1.7.2)
- CryptoSwift (0.8.0)
@ -49,6 +52,7 @@ DEPENDENCIES:
- APIKit
- BigInt (~> 3.0)
- BonMot (~> 5.0)
- Branch
- Crashlytics
- CryptoSwift (from `https://github.com/krzyzanowskim/CryptoSwift`, branch `master`)
- Eureka (~> 4.0.1)
@ -101,6 +105,7 @@ SPEC CHECKSUMS:
APIKit: 7460983f490d3bde6aaaaa4164d18c9865a6f91d
BigInt: 8e8a52161c745cd3ab78e3dc346a9fbee51e6cf6
BonMot: 3ff354572f2aa9295d3760947f7578490cb810be
Branch: 4f0482418d99e77d15b0e6065ef216c10e24797b
Crashlytics: dbb07d01876c171c5ccbdf7826410380189e452c
CryptoSwift: 475ae2a25439f52412686d68b854c0ca724c8dfd
Eureka: c8bd5cc07143b6f66268c208d28a246c99b41955
@ -127,6 +132,6 @@ SPEC CHECKSUMS:
TrezorCrypto: 7f87a2296cf13872b21565c29fd9f7882dd00803
TrustKeystore: 02614fb6b5c48fc65a0c485df7e22a44aec0c0d5
PODFILE CHECKSUM: 617ddfda209e7f0203a468d28c76f08444da5628
PODFILE CHECKSUM: c822d5e2373476315b6a83c8f096bdb9c846e467
COCOAPODS: 1.4.0

@ -2336,6 +2336,7 @@
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/BigInt/BigInt.framework",
"${BUILT_PRODUCTS_DIR}/BonMot/BonMot.framework",
"${BUILT_PRODUCTS_DIR}/Branch/Branch.framework",
"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
"${BUILT_PRODUCTS_DIR}/Eureka/Eureka.framework",
"${BUILT_PRODUCTS_DIR}/JSONRPCKit/JSONRPCKit.framework",
@ -2363,6 +2364,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BigInt.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BonMot.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Branch.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Eureka.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JSONRPCKit.framework",

@ -2,6 +2,7 @@
import UIKit
import Lokalise
import Branch
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
@ -21,6 +22,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
print("EtherKeystore init issue.")
}
protectionCoordinator.didFinishLaunchingWithOptions()
Branch.getInstance().initSession(launchOptions: launchOptions, andRegisterDeepLinkHandler: {params, error in
if error == nil {
print("params: %@", params as? [String: AnyObject] ?? {})
}
})
return true
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
@ -43,4 +50,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
}
return true
}
// Respond to URI scheme links
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
let branchHandled = Branch.getInstance().application(application,
open: url,
sourceApplication: sourceApplication,
annotation: annotation
)
if !branchHandled {
// If not handled by Branch, do other deep link routing for the Facebook SDK, Pinterest SDK, etc
}
// do other deep link routing for the Facebook SDK, Pinterest SDK, etc
return true
}
// Respond to Universal Links
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
Branch.getInstance().continue(userActivity)
return true
}
}

@ -101,5 +101,12 @@
<false/>
<key>com.apple.security.get-task-allow</key>
<true/>
<key>branch_key</key>
<dict>
<key>live</key>
<string>key_live_lfvIpVeI9TFWxPCqwU8rZnogFqhnzs4D</string>
<key>test</key>
<string>key_test_odFMiPaHXUB4zNECuK28kdboCqgkAF3K</string>
</dict>
</dict>
</plist>

@ -4,6 +4,11 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:eps2.app.link</string>
<string>applinks:eps2-alternate.app.link</string>
</array>
<key>com.apple.developer.default-data-protection</key>
<string>NSFileProtectionComplete</string>
<key>com.apple.developer.icloud-container-identifiers</key>

@ -9,7 +9,7 @@ struct EnterPasswordViewModel {
}
var headerSectionText: String {
return NSLocalizedString("enterPassword.password.header.placeholder", value: "Password used to encrypt you backup file to keep it secure", comment: "")
return NSLocalizedString("enterPassword.password.header.placeholder", value: "Password used to encrypt you backup file to keep it secure!", comment: "")
}
var passwordFieldPlaceholder: String {

Loading…
Cancel
Save