Skip to content

Commit

Permalink
Merge branch 'release/0.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBonus committed Mar 23, 2018
2 parents 02d100c + f72253d commit 26cb017
Show file tree
Hide file tree
Showing 52 changed files with 1,109 additions and 198 deletions.
20 changes: 19 additions & 1 deletion Adamant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
E91947B020002393001362F8 /* AdamantApiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91947AF20002393001362F8 /* AdamantApiService.swift */; };
E91947B22000246A001362F8 /* AdamantError.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91947B12000246A001362F8 /* AdamantError.swift */; };
E91947B420002809001362F8 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91947B320002809001362F8 /* Account.swift */; };
E9215973206119FB0000CA5C /* ReachabilityMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9215972206119FB0000CA5C /* ReachabilityMonitor.swift */; };
E921597520611A6A0000CA5C /* AdamantReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = E921597420611A6A0000CA5C /* AdamantReachability.swift */; };
E921597B206503000000CA5C /* ButtonsStripeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E921597A206503000000CA5C /* ButtonsStripeView.swift */; };
E921597D2065031D0000CA5C /* ButtonsStripe.xib in Resources */ = {isa = PBXBuildFile; fileRef = E921597C2065031D0000CA5C /* ButtonsStripe.xib */; };
E9256F5F2034C21100DE86E9 /* String+localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9256F5E2034C21100DE86E9 /* String+localized.swift */; };
E9256F6D20357B1700DE86E9 /* LoginHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9256F6C20357B1700DE86E9 /* LoginHeader.xib */; };
E9256F762039A9A200DE86E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E9256F752039A9A200DE86E9 /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -202,6 +206,10 @@
E91947AF20002393001362F8 /* AdamantApiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdamantApiService.swift; sourceTree = "<group>"; };
E91947B12000246A001362F8 /* AdamantError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdamantError.swift; sourceTree = "<group>"; };
E91947B320002809001362F8 /* Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
E9215972206119FB0000CA5C /* ReachabilityMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReachabilityMonitor.swift; sourceTree = "<group>"; };
E921597420611A6A0000CA5C /* AdamantReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdamantReachability.swift; sourceTree = "<group>"; };
E921597A206503000000CA5C /* ButtonsStripeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonsStripeView.swift; sourceTree = "<group>"; };
E921597C2065031D0000CA5C /* ButtonsStripe.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ButtonsStripe.xib; sourceTree = "<group>"; };
E9256F5E2034C21100DE86E9 /* String+localized.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+localized.swift"; sourceTree = "<group>"; };
E9256F6C20357B1700DE86E9 /* LoginHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginHeader.xib; sourceTree = "<group>"; };
E9256F752039A9A200DE86E9 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -413,6 +421,7 @@
E90A494C204DA932009F6A65 /* LocalAuthentication.swift */,
E93D7ABD2052CEE1005D19DC /* NotificationsService.swift */,
E9A174B22057EC47003667CD /* BackgroundFetchService.swift */,
E9215972206119FB0000CA5C /* ReachabilityMonitor.swift */,
);
path = ServiceProtocols;
sourceTree = "<group>";
Expand All @@ -427,6 +436,7 @@
E9E7CDBF2003AF6D00DFC4DB /* AdamantCellFactory.swift */,
E9E7CD8E20026CD300DFC4DB /* AdamantDialogService.swift */,
E93D7ABF2052CF63005D19DC /* AdamantNotificationService.swift */,
E921597420611A6A0000CA5C /* AdamantReachability.swift */,
E913C9161FFFAF76001A83F7 /* JSAdamantCore.swift */,
E905D39A2048A9BD00DDB504 /* KeychainStore.swift */,
E950273F202E257E002C1098 /* RepeaterService.swift */,
Expand Down Expand Up @@ -707,9 +717,11 @@
E9FAE5DB203ECD41008D3A6B /* Shared */ = {
isa = PBXGroup;
children = (
E94E7B07205D4CB80042B639 /* SharedRoutes.swift */,
E9FAE5E0203ED1AE008D3A6B /* ShareQrViewController.swift */,
E9FAE5E1203ED1AE008D3A6B /* ShareQrViewController.xib */,
E94E7B07205D4CB80042B639 /* SharedRoutes.swift */,
E921597A206503000000CA5C /* ButtonsStripeView.swift */,
E921597C2065031D0000CA5C /* ButtonsStripe.xib */,
);
path = Shared;
sourceTree = "<group>";
Expand Down Expand Up @@ -813,6 +825,7 @@
E9EC341F200524CA00C0E546 /* Roboto_700_normal.ttf in Resources */,
E9942B89203D9ECA00C163AF /* QrCell.xib in Resources */,
E95CB465205D8BBA00A7218E /* AccountCell.xib in Resources */,
E921597D2065031D0000CA5C /* ButtonsStripe.xib in Resources */,
E9C51EED2011416E00385EB7 /* adamant-core.js in Resources */,
E90A4945204C6204009F6A65 /* PassphraseCell.xib in Resources */,
E9E7CDC82003F6D200DFC4DB /* TransactionTableViewCell.xib in Resources */,
Expand Down Expand Up @@ -870,6 +883,7 @@
"${BUILT_PRODUCTS_DIR}/MyLittlePinpad/MyLittlePinpad.framework",
"${BUILT_PRODUCTS_DIR}/QRCodeReader.swift/QRCodeReader.framework",
"${BUILT_PRODUCTS_DIR}/RNCryptor/RNCryptor.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/Swinject/Swinject.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -884,6 +898,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MyLittlePinpad.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QRCodeReader.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCryptor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Swinject.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -939,12 +954,14 @@
E9CE778A202B9DC2009CF70D /* ChatTransaction+CoreDataProperties.swift in Sources */,
E9CAE8DA2018ACD300345E76 /* AdamantApi+Chats.swift in Sources */,
E91947B020002393001362F8 /* AdamantApiService.swift in Sources */,
E921597B206503000000CA5C /* ButtonsStripeView.swift in Sources */,
E9E7CD8D20026B6600DFC4DB /* DialogService.swift in Sources */,
E9E7CDB72003994E00DFC4DB /* AdamantUtilities.swift in Sources */,
E9147B6320505C7500145913 /* QRCodeReader+adamant.swift in Sources */,
E93D7AC22052EE21005D19DC /* SettingsViewController+StayIn.swift in Sources */,
E9942B80203C058C00C163AF /* QRGeneratorViewController.swift in Sources */,
E948E0462024DAE800975D6B /* AdamantUserInfoKeys.swift in Sources */,
E921597520611A6A0000CA5C /* AdamantReachability.swift in Sources */,
E9E7CD9120026FA100DFC4DB /* SwinjectDependencies.swift in Sources */,
E9E7CD8B20026B0600DFC4DB /* AccountService.swift in Sources */,
E9B3D39A201F90570019EB36 /* AccountsProvider.swift in Sources */,
Expand All @@ -960,6 +977,7 @@
E95F85B3200954D00070534A /* ChatModels.xcdatamodeld in Sources */,
E95F858B200931410070534A /* TransactionAsset.swift in Sources */,
E90A494B204D9EB8009F6A65 /* AdamantAuthentication.swift in Sources */,
E9215973206119FB0000CA5C /* ReachabilityMonitor.swift in Sources */,
E9E7CDAC2002AFA500DFC4DB /* AccountViewController.swift in Sources */,
E91947B420002809001362F8 /* Account.swift in Sources */,
E9E7CDC22003F5A400DFC4DB /* TransactionsViewController.swift in Sources */,
Expand Down
49 changes: 45 additions & 4 deletions Adamant/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,38 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
tabbar.setViewControllers([account, chatList, settings], animated: false)
}

// MARK: 5 Autoupdate
// MARK: 5 Reachability & Autoupdate
repeater = RepeaterService()

// Configure reachability
if let reachability = container.resolve(ReachabilityMonitor.self) {
reachability.start()

switch reachability.connection {
case .cellular, .wifi:
break

case .none:
repeater.pauseAll()
}

NotificationCenter.default.addObserver(forName: .adamantReachabilityChanged, object: reachability, queue: nil) { [weak self] notification in
guard let connection = notification.userInfo?[AdamantUserInfoKey.ReachabilityMonitor.connection] as? AdamantConnection,
let repeater = self?.repeater else {
return
}

switch connection {
case .cellular, .wifi:
repeater.resumeAll()

case .none:
repeater.pauseAll()
}
}
}

// Register repeater services
if let chatsProvider = container.resolve(ChatsProvider.self),
let transfersProvider = container.resolve(TransfersProvider.self),
let accountService = container.resolve(AccountService.self) {
Expand Down Expand Up @@ -134,11 +164,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func applicationDidBecomeActive(_ application: UIApplication) {
repeater.resumeAll()

if accountService?.account != nil {
notificationService?.removeAllDeliveredNotifications()
}

if let connection = container.resolve(ReachabilityMonitor.self)?.connection {
switch connection {
case .wifi, .cellular:
repeater.resumeAll()

case .none:
break
}
} else {
repeater.resumeAll()
}
}
}

Expand Down Expand Up @@ -195,4 +235,5 @@ extension AppDelegate {
}

completionHandler(.noData)
}}
}
}
6 changes: 6 additions & 0 deletions Adamant/Assets/Assets.xcassets/Stripe/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Stripe_FaceID.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Stripe_Pinpad.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Stripe_Camera.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Stripe_QRLibrary.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Stripe_TouchID.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions Adamant/Assets/l18n/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
/* Chat: Message is too long */
"ChatScene.Error.MessageTooLong" = "Message is too long";

/* Chat: Network problems. In most cases - no connection */
"ChatScene.Error.NoNetwork" = "No connection";

/* Chat: Notify user that he doesn't have money to pay a message fee */
"ChatScene.Error.NotEnoughMoney" = "You don't have enought money to send a message";

Expand All @@ -115,12 +118,18 @@
/* Login: Notify user, that he disabled camera in settings, and need to authorize application. */
"LoginScene.Error.AuthorizeCamera" = "You need to authorize Adamant to use device's Camera";

/* Login: User disabled access to photolibrary, he can authorize application in settings */
"LoginScene.Error.AuthorizePhotolibrary" = "You need to authorize Adamant to use your Photolibrary";

/* Login: No network error. */
"LoginScene.Error.NoInternet" = "No connection to the Internet";

/* Login: notify user that he is trying to login without a passphrase */
"LoginScene.Error.NoPassphrase" = "Enter a passphrase";

/* Login: Notify user that picked photo doesn't contains a valid qr code with passphrase */
"LoginScene.Error.NoQrOnPhoto" = "Selected image does not contain valid QR-codes";

/* Login: Notify user that device not supported by QR reader */
"LoginScene.Error.QrNotSupported" = "QR code reading not supported by the device";

Expand Down Expand Up @@ -271,12 +280,18 @@
/* Shared alert 'Save' button. Used anywhere */
"Shared.Save" = "Save";

/* Shared alert 'Save to Photos'. Used with saving images to photolibrary */
"Shared.SaveToPhotolibrary" = "Save to Photos";

/* Shared alert 'Settings' button. Used to go to system Settings app, on application settings page. Should be same as Settings application title. */
"Shared.Settings" = "Settings";

/* Shared alert 'Share' button. Used anywhere for presenting standart iOS 'Share' menu. */
"Shared.Share" = "Share";

/* ShareQR scene: User had not authorized access to write images to photolibrary */
"ShareQR.photolibraryNotAuthorized" = "You need to authorize Adamant to use your Photolibrary";

/* Main tab bar: Account page */
"Tabs.Account" = "Account";

Expand Down
Loading

0 comments on commit 26cb017

Please sign in to comment.