Parcourir la source

集成蒲公英更新

南鑫林 il y a 6 ans
Parent
commit
a94a0629a4

+ 4 - 0
RainbowPlanet/Podfile

@@ -78,6 +78,10 @@ target 'RainbowPlanet' do
   pod 'BMKLocationKit'
   # 百度地图SDK
   pod 'BaiduMapKit'
+  
+  #=====================蒲公英===========
+  # 蒲公英更新
+  pod 'PgyUpdate'
 
 
 end

+ 5 - 1
RainbowPlanet/Podfile.lock

@@ -23,6 +23,7 @@ PODS:
     - Moya/Core
     - RxSwift (~> 4.0)
   - ObjectMapper (3.4.2)
+  - PgyUpdate (1.6)
   - PPBadgeViewSwift (3.1.0)
   - Realm (3.15.0):
     - Realm/Headers (= 3.15.0)
@@ -75,6 +76,7 @@ DEPENDENCIES:
   - MJRefresh
   - Moya/RxSwift
   - ObjectMapper
+  - PgyUpdate
   - PPBadgeViewSwift
   - RealmSwift
   - RxCocoa
@@ -110,6 +112,7 @@ SPEC REPOS:
     - MJRefresh
     - Moya
     - ObjectMapper
+    - PgyUpdate
     - PPBadgeViewSwift
     - Realm
     - RealmSwift
@@ -143,6 +146,7 @@ SPEC CHECKSUMS:
   MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437
   Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
   ObjectMapper: 0d4402610f4e468903ae64629eec4784531e5c51
+  PgyUpdate: cd6c2ada5928f36a9f904d8f96a9b3b53e190755
   PPBadgeViewSwift: 18a219a9897f418342c22dd1a54f7b18ac56546b
   Realm: 9b834e1be6062f544805252c812348872dc5d4ed
   RealmSwift: 8a41886f8ab6efef9eb8df97de2f2bb911561a79
@@ -159,6 +163,6 @@ SPEC CHECKSUMS:
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
 
-PODFILE CHECKSUM: 49bfe27defc187ee34a3de662667b0ab9a9418c5
+PODFILE CHECKSUM: a5c3f1b2448f60fc19b3b8224a9abecf194e0fde
 
 COCOAPODS: 1.6.2

+ 12 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -158,6 +158,7 @@
 		A738D205225AF90D00EEE860 /* WeChatpayOrderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A738D204225AF90D00EEE860 /* WeChatpayOrderModel.swift */; };
 		A738D66F225D9BD900EEE860 /* UMLoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A738D66E225D9BD900EEE860 /* UMLoginModel.swift */; };
 		A73911AD229CD62F0033177E /* AlamofireReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73911AC229CD62F0033177E /* AlamofireReachabilityManager.swift */; };
+		A73911B0229E4D970033177E /* PGYManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73911AF229E4D970033177E /* PGYManager.swift */; };
 		A73D7C682268A032002A4CE3 /* SwiftyStarRatingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73D7C672268A032002A4CE3 /* SwiftyStarRatingView.swift */; };
 		A75414FD224B5F28002480B5 /* MobileLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75414FB224B5F28002480B5 /* MobileLoginViewController.swift */; };
 		A7541502224C5ECB002480B5 /* BaiduMapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7541501224C5ECA002480B5 /* BaiduMapManager.swift */; };
@@ -546,6 +547,7 @@
 		A738D204225AF90D00EEE860 /* WeChatpayOrderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeChatpayOrderModel.swift; sourceTree = "<group>"; };
 		A738D66E225D9BD900EEE860 /* UMLoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UMLoginModel.swift; sourceTree = "<group>"; };
 		A73911AC229CD62F0033177E /* AlamofireReachabilityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireReachabilityManager.swift; sourceTree = "<group>"; };
+		A73911AF229E4D970033177E /* PGYManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PGYManager.swift; sourceTree = "<group>"; };
 		A73D7C672268A032002A4CE3 /* SwiftyStarRatingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftyStarRatingView.swift; sourceTree = "<group>"; };
 		A75414FB224B5F28002480B5 /* MobileLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MobileLoginViewController.swift; sourceTree = "<group>"; };
 		A7541501224C5ECA002480B5 /* BaiduMapManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaiduMapManager.swift; sourceTree = "<group>"; };
@@ -1488,6 +1490,7 @@
 		A72A725422321B9400B21995 /* Manager */ = {
 			isa = PBXGroup;
 			children = (
+				A73911AE229E4D780033177E /* PGYManager */,
 				A73911AB229CD6080033177E /* AlamofireReachabilityManager */,
 				A7778CA52243A03400C7C47A /* IQKeyboardManagerSwiftManager */,
 				A72A730522321F1D00B21995 /* PayManager */,
@@ -1720,6 +1723,14 @@
 			path = AlamofireReachabilityManager;
 			sourceTree = "<group>";
 		};
+		A73911AE229E4D780033177E /* PGYManager */ = {
+			isa = PBXGroup;
+			children = (
+				A73911AF229E4D970033177E /* PGYManager.swift */,
+			);
+			path = PGYManager;
+			sourceTree = "<group>";
+		};
 		A73D7C662268A032002A4CE3 /* SwiftyStarRatingView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3471,6 +3482,7 @@
 				A72A72D522321E2700B21995 /* ColorMacro.swift in Sources */,
 				A72A7333223256E100B21995 /* PayManager.swift in Sources */,
 				A70B2C6722887B2B00B2449F /* ProductDetailEvaluationListTableViewCell.swift in Sources */,
+				A73911B0229E4D970033177E /* PGYManager.swift in Sources */,
 				BD1DC6CD228D160D00B89C57 /* OrderPurchaseModel.swift in Sources */,
 				A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */,
 				A7FF1555228AC27600A85748 /* ProductAllCommentView.swift in Sources */,

+ 3 - 1
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -20,9 +20,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         UMManager.shared().initUM(launchOptions: launchOptions)
         DispatchQueue.global(qos: .default).async {
             //初始化百度地图
-            BaiduMapManager.shared().initBaiduMap()
+            BaiduMapManager.shared.initBaiduMap()
             //初始化键盘
             IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
+            //蒲公英
+            PGYManager.shared.initPGY()
         }
     
         return true

+ 3 - 0
RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h

@@ -49,5 +49,8 @@
 //只引入所需的单个头文件
 #import <BaiduMapAPI_Map/BMKMapView.h>
 
+//蒲公英
+#import <PgyUpdate/PgyUpdateManager.h>
+
 
 #endif /* RainbowPlanet_Bridging_Header_h */

+ 2 - 8
RainbowPlanet/RainbowPlanet/Macro/ThirdPartyMacro.swift

@@ -8,7 +8,6 @@
 
 import Foundation
 
-
 //MARK: - UMeng
 let kUMengAppKey  = "5c984a7f0cafb2332300000f"
 let kUMengAppSecret  = "lpx7kstlnlrxmimo5gfyzvtscrtguhw8"
@@ -28,13 +27,8 @@ let kWeiboAppSecret  = "79d36bfe6b75638ece14d5d852e785c4"
 //MARK: - 百度地图
 let kBaiduMapAppKey  = "v7wFjrAQdlaBVC50CjwuRESC3Lu0xkhj"
 
-//MARK: - 高德地图
-let kAMapAppKey  = "daae215db1937220769796457b8d0327"
-
-
 //MARK: - aliPay
-
 let kAliPayManagerAppKey  = "2019032763726287"
 
-
-
+//MARK: - 蒲公英
+let kPGYAppKey  = "4a6881672d4a91f5b82e94432c94565f"

+ 3 - 7
RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager/BaiduMapManager.swift

@@ -10,15 +10,11 @@ import UIKit
 import SwiftyJSON
 
 public class BaiduMapManager: NSObject {
-
-    private static let _sharedInstance = BaiduMapManager()
-
+    
+    static let shared : BaiduMapManager = BaiduMapManager()
+    
     private override init() {} // 私有化init方法
 
-    class func shared() -> BaiduMapManager {
-        return _sharedInstance
-    }
-
     var locationModel = LocationModel.shared()
 
     typealias LocationSuccessBlock = () -> Void

+ 21 - 0
RainbowPlanet/RainbowPlanet/Manager/PGYManager/PGYManager.swift

@@ -0,0 +1,21 @@
+//
+//  PGYManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/29.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PGYManager: NSObject {
+    static let shared : PGYManager = PGYManager()
+    
+    /// 初始化蒲公英
+    public func initPGY() {
+        if !kProductSever {
+            PgyUpdateManager.sharedPgy()?.start(withAppId: kPGYAppKey)
+            PgyUpdateManager.sharedPgy()?.checkUpdate()
+        }
+    }
+}

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/View/AddressPOIView.swift

@@ -123,8 +123,8 @@ class AddressPOIView: BaseView {
         searchTextField.borderStyle = .none
         searchTextField.rx.text.orEmpty.changed.subscribe(onNext: { (text) in
             
-                BaiduMapManager.shared().suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: text)
-                BaiduMapManager.shared().suggestionSearchSuccessBlock = {
+                BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: text)
+                BaiduMapManager.shared.suggestionSearchSuccessBlock = {
                     [weak self] (suggestionList:Array<BMKSuggestionInfo>) in
                     self?.suggestionList = suggestionList
                     self?.tableView.reloadSections([1], with: UITableView.RowAnimation.fade)
@@ -178,11 +178,11 @@ extension AddressPOIView:UITableViewDataSource,UITableViewDelegate {
         switch indexPath.section {
         case 0:
             cell.refreshButtonBlock = {
-                BaiduMapManager.shared().startLocation()
-                BaiduMapManager.shared().locationSuccessBlock = {
+                BaiduMapManager.shared.startLocation()
+                BaiduMapManager.shared.locationSuccessBlock = {
                      tableView.reloadSections([0], with: UITableView.RowAnimation.fade)
                 }
-                BaiduMapManager.shared().locationFalseBlock = {
+                BaiduMapManager.shared.locationFalseBlock = {
                     SwiftProgressHUD.shared().showText("定位失败\n重新定位", textAlignment: NSTextAlignment.center)
                 }
             }

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/Location/ViewController/LocationViewController.swift

@@ -14,13 +14,13 @@ class LocationViewController: BaseViewController {
         super.viewDidLoad()
         setupViews()
         navigationBar.title = "获取地址授权中"
-        BaiduMapManager.shared().startLocation()
-        BaiduMapManager.shared().locationSuccessBlock =  {
+        BaiduMapManager.shared.startLocation()
+        BaiduMapManager.shared.locationSuccessBlock =  {
             [weak self] in
             self!.configCityManagementIndexApi()
             
         }
-        BaiduMapManager.shared().locationFalseBlock =  {
+        BaiduMapManager.shared.locationFalseBlock =  {
             [weak self] in
             self?.navigationBar.title = "未获取地理位置授权"
             self?.locationView.isHidden = true
@@ -39,7 +39,7 @@ class LocationViewController: BaseViewController {
             self?.setDeliveryMethodType()
         }
         let emptyView =  EmptyView.shared.diyCustomEmptyViewStyle1(iconStr: "page01", titleStr: "选择了自提点才能享受支持到店自提服务哦", buttonStr: "去设置", buttonActionBlock: {
-            BaiduMapManager.shared().loacationAlertView()
+            BaiduMapManager.shared.loacationAlertView()
         })
         emptyView.contentViewY = kScaleValue(value: 100) + kNavBarTotalHeight
         view.ly_emptyView = emptyView