Skip to content

Commit

Permalink
Merge branch 'sprint_2_1'
Browse files Browse the repository at this point in the history
* sprint_2_1:
  sprint 2.1 completed
  touch id, change node address
  • Loading branch information
DenisDemyanko committed Apr 25, 2019
2 parents ed203c6 + 55910e8 commit e2edd43
Show file tree
Hide file tree
Showing 119 changed files with 3,507 additions and 589 deletions.
1,112 changes: 1,066 additions & 46 deletions BeamWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92E2EACD226F21C700367928"
BuildableName = "BeamWalletMasterNet.app"
BlueprintName = "BeamWalletMasterNet"
ReferencedContainer = "container:BeamWallet.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92E2EACD226F21C700367928"
BuildableName = "BeamWalletMasterNet.app"
BlueprintName = "BeamWalletMasterNet"
ReferencedContainer = "container:BeamWallet.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92E2EACD226F21C700367928"
BuildableName = "BeamWalletMasterNet.app"
BlueprintName = "BeamWalletMasterNet"
ReferencedContainer = "container:BeamWallet.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92E2EACD226F21C700367928"
BuildableName = "BeamWalletMasterNet.app"
BlueprintName = "BeamWalletMasterNet"
ReferencedContainer = "container:BeamWallet.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
94 changes: 77 additions & 17 deletions BeamWallet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import UIKit
import Fabric
import Crashlytics
import FirebaseCore
import FirebaseMessaging

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -36,18 +38,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
enum Target: String {
case Main = "Main"
case Test = "BeamWalletTestNet"
case Master = "BeamWalletMasterNet"
}

static var CurrentTarget: Target {
switch targetName {
case Target.Test.rawValue:
return .Test
case Target.Master.rawValue:
return .Master
default:
return .Main
}
}

static var enableNewFeatures = true
static var disableApns = false
// static var enableNewFeatures = true

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

Expand All @@ -56,6 +62,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

UIApplication.shared.isIdleTimerDisabled = true

AnalyticsConfiguration.shared().setAnalyticsCollectionEnabled(false)
FirebaseApp.configure()

Crashlytics().debugMode = true
Fabric.with([Crashlytics.self()])

Expand All @@ -79,6 +88,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = UIColor.main.marineTwo


return true
}

Expand Down Expand Up @@ -117,26 +127,76 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
backgroundTask = .invalid
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Messaging.messaging().apnsToken = deviceToken
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
}


func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

print("didReceiveRemoteNotification")

if(!AppModel.sharedManager().isRestoreFlow) {
if let password = KeychainManager.getPassword() {
if NotificationManager.sharedManager.sendAutomaticMoney(data: userInfo) == false
{
self.registerBackgroundTask()

self.completionHandler = completionHandler

if(AppModel.sharedManager().isLoggedin) {
AppModel.sharedManager().refreshAllInfo()
}
else{
AppModel.sharedManager().openWallet(password)
}

DispatchQueue.main.asyncAfter(deadline: .now() + 26) {
self.endBackgroundTask()
self.completionHandler?(.newData)
}
}
else{
completionHandler(.newData)
}
}
else{
completionHandler(.noData)
}
}
else{
completionHandler(.newData)
}
}

func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

print("performFetchWithCompletionHandler")

if(!AppModel.sharedManager().isRestoreFlow) {
// if let password = KeychainManager.getPassword() {
self.completionHandler = completionHandler

self.registerBackgroundTask()

if(AppModel.sharedManager().isLoggedin) {
AppModel.sharedManager().refreshAllInfo()
if let password = KeychainManager.getPassword() {
self.completionHandler = completionHandler

self.registerBackgroundTask()

if(AppModel.sharedManager().isLoggedin) {
AppModel.sharedManager().refreshAllInfo()
}
else{
AppModel.sharedManager().openWallet(password)
}

DispatchQueue.main.asyncAfter(deadline: .now() + 26) {
self.endBackgroundTask()
self.completionHandler?(.newData)
}
}
// else{
// AppModel.sharedManager().openWallet(password)
// }

DispatchQueue.main.asyncAfter(deadline: .now() + 26) {
self.endBackgroundTask()
self.completionHandler?(.newData)
else{
completionHandler(.noData)
}
// }
}
else{
completionHandler(.noData)
Expand All @@ -148,7 +208,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
extension AppDelegate : WalletModelDelegate {
public func onReceivedTransactions(_ transactions: [BMTransaction]) {
DispatchQueue.main.async {

var oldTransactions = [BMTransaction]()

//get old notifications
Expand Down
12 changes: 9 additions & 3 deletions BeamWallet/BeamSDK/AppModel.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//
// AppModel.h
// BeamTest
// AppModel.h
// BeamTest
//
// 2/28/19.
// Copyright 2018 Beam Development
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -84,6 +83,8 @@
-(BOOL)isValidPassword:(NSString*_Nonnull)pass;
-(void)changePassword:(NSString*_Nonnull)pass;
-(void)onSyncWithLocalNodeCompleted;
-(void)changeNodeAddress;
-(BOOL)isValidNodeAddress:(NSString*_Nonnull)string;

// updates
-(void)getWalletStatus;
Expand All @@ -92,6 +93,7 @@

// addresses
-(void)generateNewWalletAddress;
-(void)editBotAddress:(NSString*_Nonnull)address ;
-(void)setExpires:(int)hours toAddress:(NSString*_Nonnull)address ;
-(void)setWalletComment:(NSString*_Nonnull)comment toAddress:(NSString*_Nonnull)address ;
-(NSMutableArray<BMTransaction*>*_Nonnull)getTransactionsFromAddress:(BMAddress*_Nonnull)address;
Expand All @@ -101,6 +103,8 @@
-(BOOL)isValidAddress:(NSString*_Nullable)address;
-(BOOL)isExpiredAddress:(NSString*_Nullable)address;
-(BOOL)isAddressDeleted:(NSString*_Nullable)address;
-(BOOL)isMyAddress:(NSString*_Nullable)address;
-(void)clearAllAddresses;


// send
Expand All @@ -118,6 +122,7 @@
-(void)resumeTransaction:(BMTransaction*_Nonnull)transaction;
-(NSMutableArray<BMUTXO*>*_Nonnull)getUTXOSFromTransaction:(BMTransaction*_Nonnull)transaction;
-(void)exportTransactionsToCSV:(void(^_Nonnull)(NSURL*_Nonnull))callback;
-(void)clearAllTransactions;

// utxo
-(void)getUTXO;
Expand All @@ -126,5 +131,6 @@

//contacts
-(BMContact*_Nullable)getContactFromId:(NSString*_Nonnull)idValue;
-(void)clearAllContacts;

@end
Loading

0 comments on commit e2edd43

Please sign in to comment.