Skip to content

Commit

Permalink
Release 1.2.6 (115)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Apr 26, 2023
1 parent 25aa0b0 commit 27996da
Show file tree
Hide file tree
Showing 92 changed files with 606 additions and 1,496 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- beta
- beta-hotfix

workflow_dispatch:

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Nicegram/NGCopyProtectedContent/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ swift_library(
deps = [
"//Nicegram/NGData:NGData",
"//Nicegram/NGRemoteConfig:NGRemoteConfig",
"//Nicegram/NGSubscription:NGSubscription",
"@swiftpkg_nicegram_assistant_ios//:Sources_NGPremiumUI",
],
visibility = [
"//visibility:public",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Foundation
import NGData
import NGPremiumUI
import NGRemoteConfig
import NGSubscription
import Postbox
import TelegramPresentationData
import UIKit

// MARK: - Logic
Expand Down Expand Up @@ -34,8 +33,8 @@ public func shouldSubscribeToCopyContent(message: Message) -> Bool {
}
}

public func routeToNicegramPremiumForCopyContent(presentationData: PresentationData) {
routeToNicegramPremium(presentationData: presentationData)
public func routeToNicegramPremiumForCopyContent() {
PremiumUITgHelper.routeToPremium()
}

// MARK: - Bypass setting (Secret Menu)
Expand Down
3 changes: 2 additions & 1 deletion Nicegram/NGLogging/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ swift_library(
]),
deps = [
"@FirebaseSDK//:FirebaseAnalytics",
"//submodules/TelegramCore:TelegramCore"
"//submodules/TelegramCore:TelegramCore",
"@swiftpkg_nicegram_assistant_ios//:Sources_NGAnalytics",
],
visibility = [
"//visibility:public",
Expand Down
7 changes: 7 additions & 0 deletions Nicegram/NGLogging/Sources/FirebaseLogger.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FirebaseAnalytics
import NGAnalytics

public class FirebaseLogger {

Expand All @@ -12,3 +13,9 @@ extension FirebaseLogger: EventsLogger {
Analytics.logEvent(name, parameters: params)
}
}

extension FirebaseLogger: AnalyticsSender {
public func trackEvent(_ name: String, params: [String: Any]) {
Analytics.logEvent(name, parameters: params)
}
}
4 changes: 3 additions & 1 deletion Nicegram/NGOnboarding/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ swift_library(
]),
deps = [
"//Nicegram/NGData:NGData",
"//Nicegram/NGSubscription:NGSubscription",
"//Nicegram/NGStrings:NGStrings",
"//Nicegram/NGTheme:NGTheme",
"@swiftpkg_nicegram_assistant_ios//:Sources_NGPremiumUI",
],
visibility = [
"//visibility:public",
Expand Down
30 changes: 5 additions & 25 deletions Nicegram/NGOnboarding/Sources/OnboardingFlow.swift
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
import Display
import Foundation
import UIKit
import NGData
import NGPremiumUI
import NGStrings
import NGSubscription

public func onboardingController(languageCode: String, onComplete: @escaping () -> Void) -> UIViewController {
var routeToSubscription: (() -> Void)?

let controller = OnboardingViewController(
items: onboardingPages(languageCode: languageCode),
languageCode: languageCode,
onComplete: {
if isPremium() {
onComplete()
} else if #available(iOS 13.0, *) {
PremiumUITgHelper.routeToPremium(onComplete: onComplete)
} else {
routeToSubscription?()
onComplete()
}
}
)

routeToSubscription = { [weak controller] in
let c = subscriptionController(onComplete: onComplete)
c.modalPresentationStyle = .fullScreen
controller?.present(c, animated: true)
}

return controller
}

private func subscriptionController(onComplete: @escaping () -> Void) -> UIViewController {
let builder: SubscriptionBuilder = SubscriptionBuilderImpl(languageCode: Locale.currentAppLocale.langCode)
let controller = builder.build(
handlers: SubscriptionHandlers(
onSuccessPurchase: onComplete,
onSuccessRestore: onComplete,
onClose: onComplete
)
)

return controller
}

private func onboardingPages(languageCode: String) -> [OnboardingPageViewModel] {
(1...5).map { index in
(1...6).map { index in
OnboardingPageViewModel(
title: l("NicegramOnboarding.\(index).Title", languageCode),
description: l("NicegramOnboarding.\(index).Desc", languageCode),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import SnapKit
import AVKit
import NGTheme

struct OnboardingPageViewModel {
let title: String
Expand Down
11 changes: 2 additions & 9 deletions Nicegram/NGSubscription/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ swift_library(
"Sources/**/*.swift",
]),
deps = [
"@swiftpkg_snapkit//:Sources_SnapKit",
"@swiftpkg_nicegram_assistant_ios//:Sources_NGCoreUI",
"//submodules/Markdown:Markdown",
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//Nicegram/NGStrings:NGStrings",
"//Nicegram/SubscriptionAnalytics:SubscriptionAnalytics",
"//Nicegram/NGLoadingIndicator:NGLoadingIndicator",
"//Nicegram/NGEnv:NGEnv",
"//Nicegram/NGTheme:NGTheme",
"@swiftpkg_nicegram_assistant_ios//:Sources_NGPremium",
"//Nicegram/SubscriptionAnalytics:SubscriptionAnalytics",
],
visibility = [
"//visibility:public",
Expand Down
70 changes: 0 additions & 70 deletions Nicegram/NGSubscription/Sources/SubscriptionBuilder.swift

This file was deleted.

114 changes: 0 additions & 114 deletions Nicegram/NGSubscription/Sources/SubscriptionInteractor.swift

This file was deleted.

Loading

0 comments on commit 27996da

Please sign in to comment.