Skip to content

Commit

Permalink
完成全部主体功能, iOS已经可以正常使用
Browse files Browse the repository at this point in the history
  • Loading branch information
Hext123 committed Jan 9, 2022
1 parent eec94f9 commit c30d49d
Show file tree
Hide file tree
Showing 25 changed files with 759 additions and 137 deletions.
4 changes: 4 additions & 0 deletions ios/PushDeer-iOS/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use_frameworks!
def commonPods
# Pods for common
pod 'Moya', '~> 15.0'
pod 'SDWebImageSwiftUI', '~> 2.0.2'
pod 'KRProgressHUD', '~> 3.4.7'

# pod 'WoodPeckeriOS', :configurations => ['Debug']
end

target 'PushDeer' do
Expand Down
20 changes: 19 additions & 1 deletion ios/PushDeer-iOS/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
PODS:
- Alamofire (5.5.0)
- KRActivityIndicatorView (3.0.7)
- KRProgressHUD (3.4.7):
- KRActivityIndicatorView (= 3.0.7)
- Moya (15.0.0):
- Moya/Core (= 15.0.0)
- Moya/Core (15.0.0):
- Alamofire (~> 5.0)
- SDWebImage (5.12.1):
- SDWebImage/Core (= 5.12.1)
- SDWebImage/Core (5.12.1)
- SDWebImageSwiftUI (2.0.2):
- SDWebImage (~> 5.10)

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

SPEC REPOS:
trunk:
- Alamofire
- KRActivityIndicatorView
- KRProgressHUD
- Moya
- SDWebImage
- SDWebImageSwiftUI

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

PODFILE CHECKSUM: 71abdebce610eefe1a0299d0a0bd00a463b0a79c
PODFILE CHECKSUM: e462e86a9cce18b92c573f662ef405e7091cd912

COCOAPODS: 1.11.2
59 changes: 55 additions & 4 deletions ios/PushDeer-iOS/PushDeer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@
52450F432784943F003652D8 /* HttpRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52450F412784943F003652D8 /* HttpRequest.swift */; };
52483FC2277ED6D5003A100E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52483FC1277ED6D5003A100E /* AppDelegate.swift */; };
52483FC3277ED6D5003A100E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52483FC1277ED6D5003A100E /* AppDelegate.swift */; };
5287FF52278ADC8C00249A0E /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 5287FF51278ADC8C00249A0E /* MarkdownUI */; };
5287FF54278AEA5B00249A0E /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 5287FF53278AEA5B00249A0E /* MarkdownUI */; };
5287FF59278B3AAE00249A0E /* HToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5287FF58278B3AAE00249A0E /* HToast.swift */; };
5287FF5A278B3AAE00249A0E /* HToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5287FF58278B3AAE00249A0E /* HToast.swift */; };
5292F4F92776BC7900B9A7BB /* PushDeerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5292F4F82776BC7900B9A7BB /* PushDeerApp.swift */; };
5292F4FB2776BC7900B9A7BB /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5292F4FA2776BC7900B9A7BB /* ContentView.swift */; };
5292F4FD2776BC7A00B9A7BB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5292F4FC2776BC7A00B9A7BB /* Assets.xcassets */; };
5292F5002776BC7A00B9A7BB /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5292F4FF2776BC7A00B9A7BB /* Preview Assets.xcassets */; };
52B8CF5F277DE660004CB680 /* AppleSignInButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8CF5E277DE660004CB680 /* AppleSignInButton.swift */; };
52B8CF67277E0B44004CB680 /* PushDeerClipApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8CF66277E0B44004CB680 /* PushDeerClipApp.swift */; };
52B8CF69277E0B44004CB680 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8CF68277E0B44004CB680 /* ContentView.swift */; };
52B8CF6B277E0B46004CB680 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52B8CF6A277E0B46004CB680 /* Assets.xcassets */; };
52B8CF6E277E0B46004CB680 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52B8CF6D277E0B46004CB680 /* Preview Assets.xcassets */; };
52B8CF73277E0B46004CB680 /* PushDeerClip.app in Embed App Clips */ = {isa = PBXBuildFile; fileRef = 52B8CF64277E0B44004CB680 /* PushDeerClip.app */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
Expand All @@ -58,6 +61,7 @@
52F0243F277737470071D861 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F0243E277737470071D861 /* LoginView.swift */; };
52F2C223277961D7006F08DC /* SettingsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F2C222277961D7006F08DC /* SettingsItemView.swift */; };
52F40D2F277CA05600766C24 /* MessageItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F40D2E277CA05600766C24 /* MessageItemView.swift */; };
52FBA09427874879003308C2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5292F4FA2776BC7900B9A7BB /* ContentView.swift */; };
64B0C15E70CCC382B480F76E /* Pods_PushDeer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E380A18349DE4D26071E913E /* Pods_PushDeer.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -99,6 +103,7 @@
52450F412784943F003652D8 /* HttpRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpRequest.swift; sourceTree = "<group>"; };
52450F442784A95D003652D8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
52483FC1277ED6D5003A100E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5287FF58278B3AAE00249A0E /* HToast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HToast.swift; sourceTree = "<group>"; };
5292F4F52776BC7900B9A7BB /* PushDeer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PushDeer.app; sourceTree = BUILT_PRODUCTS_DIR; };
5292F4F82776BC7900B9A7BB /* PushDeerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushDeerApp.swift; sourceTree = "<group>"; };
5292F4FA2776BC7900B9A7BB /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand All @@ -107,7 +112,6 @@
52B8CF5E277DE660004CB680 /* AppleSignInButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleSignInButton.swift; sourceTree = "<group>"; };
52B8CF64277E0B44004CB680 /* PushDeerClip.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PushDeerClip.app; sourceTree = BUILT_PRODUCTS_DIR; };
52B8CF66277E0B44004CB680 /* PushDeerClipApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushDeerClipApp.swift; sourceTree = "<group>"; };
52B8CF68277E0B44004CB680 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
52B8CF6A277E0B46004CB680 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
52B8CF6D277E0B46004CB680 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
52B8CF6F277E0B46004CB680 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -134,6 +138,7 @@
buildActionMask = 2147483647;
files = (
64B0C15E70CCC382B480F76E /* Pods_PushDeer.framework in Frameworks */,
5287FF52278ADC8C00249A0E /* MarkdownUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -142,6 +147,7 @@
buildActionMask = 2147483647;
files = (
4812F19BB0BFEFE089BC253E /* Pods_PushDeerClip.framework in Frameworks */,
5287FF54278AEA5B00249A0E /* MarkdownUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -227,6 +233,7 @@
52B8CF5D277DE5FF004CB680 /* Common */ = {
isa = PBXGroup;
children = (
5287FF58278B3AAE00249A0E /* HToast.swift */,
52B8CF5E277DE660004CB680 /* AppleSignInButton.swift */,
);
path = Common;
Expand All @@ -236,7 +243,6 @@
isa = PBXGroup;
children = (
52B8CF66277E0B44004CB680 /* PushDeerClipApp.swift */,
52B8CF68277E0B44004CB680 /* ContentView.swift */,
52B8CF6A277E0B46004CB680 /* Assets.xcassets */,
52B8CF6F277E0B46004CB680 /* Info.plist */,
52B8CF70277E0B46004CB680 /* PushDeerClip.entitlements */,
Expand Down Expand Up @@ -311,6 +317,9 @@
52B8CF72277E0B46004CB680 /* PBXTargetDependency */,
);
name = PushDeer;
packageProductDependencies = (
5287FF51278ADC8C00249A0E /* MarkdownUI */,
);
productName = PushDeer;
productReference = 5292F4F52776BC7900B9A7BB /* PushDeer.app */;
productType = "com.apple.product-type.application";
Expand All @@ -330,6 +339,9 @@
dependencies = (
);
name = PushDeerClip;
packageProductDependencies = (
5287FF53278AEA5B00249A0E /* MarkdownUI */,
);
productName = PushDeerClip;
productReference = 52B8CF64277E0B44004CB680 /* PushDeerClip.app */;
productType = "com.apple.product-type.application.on-demand-install-capable";
Expand Down Expand Up @@ -361,6 +373,9 @@
Base,
);
mainGroup = 5292F4EC2776BC7900B9A7BB;
packageReferences = (
5287FF50278ADC8C00249A0E /* XCRemoteSwiftPackageReference "MarkdownUI" */,
);
productRefGroup = 5292F4F62776BC7900B9A7BB /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -490,6 +505,7 @@
52B8CF5F277DE660004CB680 /* AppleSignInButton.swift in Sources */,
52163EB92777417900594190 /* KeyListView.swift in Sources */,
5292F4FB2776BC7900B9A7BB /* ContentView.swift in Sources */,
5287FF59278B3AAE00249A0E /* HToast.swift in Sources */,
52450F3B278491F8003652D8 /* AppState.swift in Sources */,
5292F4F92776BC7900B9A7BB /* PushDeerApp.swift in Sources */,
52483FC2277ED6D5003A100E /* AppDelegate.swift in Sources */,
Expand All @@ -509,7 +525,6 @@
buildActionMask = 2147483647;
files = (
52B8CF82277E0C06004CB680 /* AppleSignInButton.swift in Sources */,
52B8CF69277E0B44004CB680 /* ContentView.swift in Sources */,
52B8CF78277E0BF1004CB680 /* MainView.swift in Sources */,
52B8CF79277E0BFB004CB680 /* DeviceListView.swift in Sources */,
52B8CF84277E0C12004CB680 /* CardView.swift in Sources */,
Expand All @@ -520,11 +535,13 @@
52B8CF81277E0BFB004CB680 /* LoginView.swift in Sources */,
52B8CF7F277E0BFB004CB680 /* SettingsItemView.swift in Sources */,
52450F3C278491F8003652D8 /* AppState.swift in Sources */,
5287FF5A278B3AAE00249A0E /* HToast.swift in Sources */,
52B8CF80277E0BFB004CB680 /* MessageItemView.swift in Sources */,
52483FC3277ED6D5003A100E /* AppDelegate.swift in Sources */,
52450F3927848243003652D8 /* PushDeerApi.swift in Sources */,
52B8CF86277E0C12004CB680 /* BaseNavigationView.swift in Sources */,
52B8CF67277E0B44004CB680 /* PushDeerClipApp.swift in Sources */,
52FBA09427874879003308C2 /* ContentView.swift in Sources */,
52B8CF85277E0C12004CB680 /* Line.swift in Sources */,
52450F402784923D003652D8 /* Result.swift in Sources */,
52450F432784943F003652D8 /* HttpRequest.swift in Sources */,
Expand Down Expand Up @@ -739,6 +756,10 @@
DEVELOPMENT_ASSET_PATHS = "\"PushDeerClip/Preview Content\"";
DEVELOPMENT_TEAM = Y47WTLML2S;
ENABLE_PREVIEWS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"APPCLIP=1",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PushDeerClip/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = PushDeer;
Expand All @@ -753,6 +774,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) -D APPCLIP";
PRODUCT_BUNDLE_IDENTIFIER = com.wskfz.pushdeer.ios.Clip;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -773,6 +795,10 @@
DEVELOPMENT_ASSET_PATHS = "\"PushDeerClip/Preview Content\"";
DEVELOPMENT_TEAM = Y47WTLML2S;
ENABLE_PREVIEWS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"APPCLIP=1",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PushDeerClip/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = PushDeer;
Expand All @@ -787,6 +813,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) -D APPCLIP";
PRODUCT_BUNDLE_IDENTIFIER = com.wskfz.pushdeer.ios.Clip;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -826,6 +853,30 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
5287FF50278ADC8C00249A0E /* XCRemoteSwiftPackageReference "MarkdownUI" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/gonzalezreal/MarkdownUI";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.5.2;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
5287FF51278ADC8C00249A0E /* MarkdownUI */ = {
isa = XCSwiftPackageProductDependency;
package = 5287FF50278ADC8C00249A0E /* XCRemoteSwiftPackageReference "MarkdownUI" */;
productName = MarkdownUI;
};
5287FF53278AEA5B00249A0E /* MarkdownUI */ = {
isa = XCSwiftPackageProductDependency;
package = 5287FF50278ADC8C00249A0E /* XCRemoteSwiftPackageReference "MarkdownUI" */;
productName = MarkdownUI;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 5292F4ED2776BC7900B9A7BB /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"object": {
"pins": [
{
"package": "AttributedText",
"repositoryURL": "https://github.com/gonzalezreal/AttributedText",
"state": {
"branch": null,
"revision": "c345033e22d5a1cd0e9fe0ec405cc809a8349586",
"version": "0.3.1"
}
},
{
"package": "combine-schedulers",
"repositoryURL": "https://github.com/pointfreeco/combine-schedulers",
"state": {
"branch": null,
"revision": "4cf088c29a20f52be0f2ca54992b492c54e0076b",
"version": "0.5.3"
}
},
{
"package": "MarkdownUI",
"repositoryURL": "https://github.com/gonzalezreal/MarkdownUI",
"state": {
"branch": null,
"revision": "29d94710545952dd4c724cc2ca901848eef54ded",
"version": "0.5.2"
}
},
{
"package": "NetworkImage",
"repositoryURL": "https://github.com/gonzalezreal/NetworkImage",
"state": {
"branch": null,
"revision": "04167e81ed89a14b5da9b856ead306b969bb5abd",
"version": "3.1.2"
}
},
{
"package": "cmark",
"repositoryURL": "https://github.com/SwiftDocOrg/swift-cmark.git",
"state": {
"branch": null,
"revision": "9c8096a23f44794bde297452d87c455fc4f76d42",
"version": "0.29.0+20210102.9c8096a"
}
},
{
"package": "SwiftCommonMark",
"repositoryURL": "https://github.com/gonzalezreal/SwiftCommonMark",
"state": {
"branch": null,
"revision": "ed60da54305c244d0f77bc8d08495e04161e96a4",
"version": "0.1.2"
}
},
{
"package": "xctest-dynamic-overlay",
"repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state": {
"branch": null,
"revision": "50a70a9d3583fe228ce672e8923010c8df2deddd",
"version": "0.2.1"
}
}
]
},
"version": 1
}
10 changes: 3 additions & 7 deletions ios/PushDeer-iOS/PushDeer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import UIKit
import UserNotifications

class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {

static var deviceToken: String = ""


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

let center = UNUserNotificationCenter.current()
Expand All @@ -23,9 +21,7 @@ class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDele

Task {
// APP启动后要先调一个无用接口, 用于触发国行手机的网络授权弹框, 未授权前调的接口会直接失败. (提前触发网络授权弹窗)
let result = try await HttpRequest.fake()
AppState.shared.token = result.token
HttpRequest.getDevices()
_ = try await HttpRequest.fake()
}

return true
Expand All @@ -34,7 +30,7 @@ class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDele
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
print("deviceToken: ", deviceTokenString)
AppDelegate.deviceToken = deviceTokenString;
AppState.shared.deviceToken = deviceTokenString
}

func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions {
Expand Down
Loading

0 comments on commit c30d49d

Please sign in to comment.