Skip to content

Commit 3e1c2ae

Browse files
committed
Merge branch 'release/1.0.0'
2 parents a25d920 + e7c8bb1 commit 3e1c2ae

File tree

265 files changed

+5833
-1777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+5833
-1777
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 131 additions & 47 deletions
Large diffs are not rendered by default.

Adamant/AppDelegate.swift

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,21 @@ struct AdamantResources {
4646
Node(scheme: .http, host: "80.211.177.181", port: nil)
4747
]
4848

49-
static let iosAppSupportEmail = "ios@adamant.im"
49+
// Addresses
50+
static let supportEmail = "ios@adamant.im"
51+
static let ansReadmeUrl = "https://github.com/Adamant-im/AdamantNotificationService/blob/master/README.md"
5052

51-
// ANS Contact
52-
static let ansAddress = "U10629337621822775991"
53-
static let ansPublicKey = "188b24bd116a556ac8ba905bbbdaa16e237dfb14269f5a4f9a26be77537d977c"
53+
// Contacts
54+
struct contacts {
55+
static let adamantBountyWallet = "U15423595369615486571"
56+
static let adamantIco = "U7047165086065693428"
57+
static let iosSupport = "U15738334853882270577"
58+
59+
static let ansAddress = "U10629337621822775991"
60+
static let ansPublicKey = "188b24bd116a556ac8ba905bbbdaa16e237dfb14269f5a4f9a26be77537d977c"
61+
62+
private init() {}
63+
}
5464

5565
private init() {}
5666
}
@@ -95,30 +105,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
95105
let login = router.get(scene: AdamantScene.Login.login)
96106
window!.rootViewController?.present(login, animated: false, completion: nil)
97107

98-
// MARK: 4. Async prepare pages
108+
// MARK: 4. Prepare pages
99109
if let tabbar = window?.rootViewController as? UITabBarController {
100-
let accountRoot = router.get(scene: AdamantScene.Account.account)
101-
let account = UINavigationController(rootViewController: accountRoot)
102-
account.tabBarItem.title = String.adamantLocalized.tabItems.account
103-
account.tabBarItem.image = #imageLiteral(resourceName: "wallet_tab")
104-
105110
let chatListRoot = router.get(scene: AdamantScene.Chats.chatList)
106111
let chatList = UINavigationController(rootViewController: chatListRoot)
107112
chatList.tabBarItem.title = String.adamantLocalized.tabItems.chats
108113
chatList.tabBarItem.image = #imageLiteral(resourceName: "chats_tab")
109114

110-
let settingsRoot = router.get(scene: AdamantScene.Settings.settings)
111-
let settings = UINavigationController(rootViewController: settingsRoot)
112-
settings.tabBarItem.title = String.adamantLocalized.tabItems.settings
113-
settings.tabBarItem.image = #imageLiteral(resourceName: "settings_tab")
115+
let accountRoot = router.get(scene: AdamantScene.Account.account)
116+
let account = UINavigationController(rootViewController: accountRoot)
117+
account.tabBarItem.title = String.adamantLocalized.tabItems.account
118+
account.tabBarItem.image = #imageLiteral(resourceName: "account-tab")
114119

115-
account.tabBarItem.badgeColor = UIColor.adamantPrimary
116120
chatList.tabBarItem.badgeColor = UIColor.adamantPrimary
117-
settings.tabBarItem.badgeColor = UIColor.adamantPrimary
121+
account.tabBarItem.badgeColor = UIColor.adamantPrimary
118122

119-
tabbar.setViewControllers([account, chatList, settings], animated: false)
123+
tabbar.setViewControllers([chatList, account], animated: false)
120124
}
121125

126+
122127
// MARK: 5 Reachability & Autoupdate
123128
repeater = RepeaterService()
124129

@@ -263,7 +268,7 @@ extension AppDelegate {
263268
return
264269
}
265270

266-
guard let encodedPayload = adamantCore.encodeMessage(payload, recipientPublicKey: AdamantResources.ansPublicKey, privateKey: keypair.privateKey) else {
271+
guard let encodedPayload = adamantCore.encodeMessage(payload, recipientPublicKey: AdamantResources.contacts.ansPublicKey, privateKey: keypair.privateKey) else {
267272
dialogService.showError(withMessage: "Failed to encode ANS signal. Payload: \(payload)", error: nil)
268273
return
269274
}
@@ -273,24 +278,14 @@ extension AppDelegate {
273278
fatalError("can't get api service to register device token")
274279
}
275280

276-
apiService.sendMessage(senderId: address, recipientId: AdamantResources.ansAddress, keypair: keypair, message: encodedPayload.message, type: ChatType.signal, nonce: encodedPayload.nonce) { [unowned self] result in
281+
apiService.sendMessage(senderId: address, recipientId: AdamantResources.contacts.ansAddress, keypair: keypair, message: encodedPayload.message, type: ChatType.signal, nonce: encodedPayload.nonce) { [unowned self] result in
277282
switch result {
278283
case .success:
279284
return
280285

281286
case .failure(let error):
282287
self.notificationService?.setNotificationsMode(.disabled, completion: nil)
283-
284-
switch error {
285-
case .networkError, .notLogged:
286-
self.dialogService.showWarning(withMessage: String.localizedStringWithFormat(String.adamantLocalized.application.deviceTokenSendFailed, error.localized))
287-
288-
case .accountNotFound, .serverError:
289-
self.dialogService.showError(withMessage: String.localizedStringWithFormat(String.adamantLocalized.application.deviceTokenSendFailed, error.localized), error: error)
290-
291-
case .internalError(let message, _):
292-
self.dialogService.showError(withMessage: String.localizedStringWithFormat(String.adamantLocalized.application.deviceTokenSendFailed, message), error: error)
293-
}
288+
self.dialogService.showRichError(error: error)
294289
}
295290
}
296291
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

Adamant/Assets/Assets.xcassets/Icons/account.imageset/Contents.json renamed to Adamant/Assets/Assets.xcassets/Buttons/Downvote.imageset/Contents.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"images" : [
33
{
44
"idiom" : "universal",
5-
"filename" : "account.png",
5+
"filename" : "Downvote.png",
66
"scale" : "1x"
77
},
88
{
99
"idiom" : "universal",
10-
"filename" : "account@2x.png",
10+
"filename" : "Downvote@2x.png",
1111
"scale" : "2x"
1212
},
1313
{
1414
"idiom" : "universal",
15-
"filename" : "account@3x.png",
15+
"filename" : "Downvote@3x.png",
1616
"scale" : "3x"
1717
}
1818
],
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Share_button.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "Share_button@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "Share_button@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}

Adamant/Assets/Assets.xcassets/Icons/income.imageset/Contents.json renamed to Adamant/Assets/Assets.xcassets/Buttons/Upvote.imageset/Contents.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"images" : [
33
{
44
"idiom" : "universal",
5-
"filename" : "income.png",
5+
"filename" : "Upvote.png",
66
"scale" : "1x"
77
},
88
{
99
"idiom" : "universal",
10-
"filename" : "income@2x.png",
10+
"filename" : "Upvote@2x.png",
1111
"scale" : "2x"
1212
},
1313
{
1414
"idiom" : "universal",
15-
"filename" : "income@3x.png",
15+
"filename" : "Upvote@3x.png",
1616
"scale" : "3x"
1717
}
1818
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "account-tab.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "account-tab@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "account-tab@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

Adamant/Assets/Assets.xcassets/Icons/chats_tab.imageset/Contents.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"images" : [
33
{
44
"idiom" : "universal",
5-
"filename" : "chats_tab.png",
5+
"filename" : "tab_chats.png",
66
"scale" : "1x"
77
},
88
{
99
"idiom" : "universal",
10-
"filename" : "chats_tab@2x.png",
10+
"filename" : "tab_chats@2x.png",
1111
"scale" : "2x"
1212
},
1313
{
1414
"idiom" : "universal",
15-
"filename" : "chats_tab@3x.png",
15+
"filename" : "tab_chats@3x.png",
1616
"scale" : "3x"
1717
}
1818
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Adamant/Assets/Assets.xcassets/Icons/settings_tab.imageset/Contents.json

Lines changed: 0 additions & 26 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Adamant/Assets/Assets.xcassets/Icons/wallet_tab.imageset/Contents.json

Lines changed: 0 additions & 26 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "avatar-chat-placeholder.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "avatar-chat-placeholder@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "avatar-chat-placeholder@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "avatar-placeholder.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "avatar-placeholder@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "avatar-placeholder@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "row_icon_placeholder.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "row_icon_placeholder@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "row_icon_placeholder@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

0 commit comments

Comments
 (0)