Skip to content

Commit

Permalink
添加自建服务配置, 优化交互, 修复bug.
Browse files Browse the repository at this point in the history
修改配置为pushdeer官方配置(包名,团队标识,api域名);
补充新添加的文字的英文翻译 (国际化);
设备和key是空列表时,加一个提示,让用户知道可以新增;
尝试解决列表删除项后UI偶尔没刷新的bug;
首次打开提示注册设备;
首次自动生成一个 key;
消息列表放到第一个位置;
推送测试时自动生成一个key;
后台进入前台后, 刷新本地消息列表;
键盘上方添加完成按钮, 用于收键盘;
发送推送测试后 自动收键盘;
及时清角标, 拯救强迫症;
为了保持一致, 设置页也改为可滑动;
添加SelfHosted配置, 可以直接一套代码跑出两种版本;
支持服务自建;
添加Env统一管理环境变量.
  • Loading branch information
Hext123 committed Feb 13, 2022
1 parent 19d8e25 commit d3050e1
Show file tree
Hide file tree
Showing 64 changed files with 1,472 additions and 96 deletions.
1 change: 1 addition & 0 deletions ios/PushDeer-iOS/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def commonPods
pod 'Moya', '~> 15.0'
pod 'SDWebImageSwiftUI', '~> 2.0.2'
pod 'KRProgressHUD', '~> 3.4.7'
pod 'IQKeyboardManagerSwift', '~> 6.5.9'

# pod 'WoodPeckeriOS', :configurations => ['Debug']
end
Expand Down
6 changes: 5 additions & 1 deletion ios/PushDeer-iOS/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PODS:
- Alamofire (5.5.0)
- IQKeyboardManagerSwift (6.5.9)
- KRActivityIndicatorView (3.0.7)
- KRProgressHUD (3.4.7):
- KRActivityIndicatorView (= 3.0.7)
Expand All @@ -14,13 +15,15 @@ PODS:
- SDWebImage (~> 5.10)

DEPENDENCIES:
- IQKeyboardManagerSwift (~> 6.5.9)
- KRProgressHUD (~> 3.4.7)
- Moya (~> 15.0)
- SDWebImageSwiftUI (~> 2.0.2)

SPEC REPOS:
trunk:
- Alamofire
- IQKeyboardManagerSwift
- KRActivityIndicatorView
- KRProgressHUD
- Moya
Expand All @@ -29,12 +32,13 @@ SPEC REPOS:

SPEC CHECKSUMS:
Alamofire: 1c4fb5369c3fe93d2857c780d8bbe09f06f97e7c
IQKeyboardManagerSwift: 6e839c575c4aa1078d58a596e41244e77abe918f
KRActivityIndicatorView: ad69e89c4ce40c986cf580595be4829dcad0e35a
KRProgressHUD: a248f0bc6c9c2aed40a37b76e03ffecc7f85c887
Moya: 138f0573e53411fb3dc17016add0b748dfbd78ee
SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b
SDWebImageSwiftUI: 8a3923c95108312b03a599ec1498754af55a6819

PODFILE CHECKSUM: 06aae1de50f9c1a188e69787835ec8718dd7d543
PODFILE CHECKSUM: 3c8d668f811e3c29bb70fc8a24d2ecd9c266ba45

COCOAPODS: 1.11.2
365 changes: 349 additions & 16 deletions ios/PushDeer-iOS/PushDeer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug-SelfHosted"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug-SelfHosted"
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 = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release-SelfHosted"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug-SelfHosted">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release-SelfHosted"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</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 = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5292F4F42776BC7900B9A7BB"
BuildableName = "PushDeer.app"
BlueprintName = "PushDeer"
ReferencedContainer = "container:PushDeer.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
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52B8CF63277E0B44004CB680"
BuildableName = "PushDeerClip.app"
BlueprintName = "PushDeerClip"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug-SelfHosted"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug-SelfHosted"
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 = "52B8CF63277E0B44004CB680"
BuildableName = "PushDeerClip.app"
BlueprintName = "PushDeerClip"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "_XCAppClipURL"
value = "https://example.com"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release-SelfHosted"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52B8CF63277E0B44004CB680"
BuildableName = "PushDeerClip.app"
BlueprintName = "PushDeerClip"
ReferencedContainer = "container:PushDeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug-SelfHosted">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release-SelfHosted"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
7 changes: 7 additions & 0 deletions ios/PushDeer-iOS/PushDeer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@

import UIKit
import UserNotifications
import IQKeyboardManagerSwift

class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {

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

// 注册通知
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.badge, .sound, .alert]) { granted, error in
print("注册通知结果: \(granted) - \(String(describing: error))")
}
application.registerForRemoteNotifications()

// 首次网络请求提示
Task {
let notFirstStart = UserDefaults.standard.bool(forKey: "PushDeer_notFirstStart")
if !notFirstStart {
Expand All @@ -28,6 +31,10 @@ class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDele
}
}

// IQ键盘管理
IQKeyboardManager.shared.enable = false // 键盘与输入框的距离管理 禁用
IQKeyboardManager.shared.enableAutoToolbar = true // 键盘上方添加的工具栏 启用

return true
}

Expand Down
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d3050e1

Please sign in to comment.