Commit a57fb0db14e6eb1dcd0d7ba193d7880274b0addf

Authored by “张旭”
1 parent 152a0e0e

更新环境库, 增加元码正式环境

支持苹果内购
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
@@ -12,7 +12,7 @@ import CNLiveShareToolKit @@ -12,7 +12,7 @@ import CNLiveShareToolKit
12 import CommonCrypto 12 import CommonCrypto
13 import CNLiveBusinessTools 13 import CNLiveBusinessTools
14 import SKPhotoBrowser 14 import SKPhotoBrowser
15 -//import CNLivePayCostModule 15 +import CNLivePayCostModule
16 16
17 //返回 Web控制器回调 17 //返回 Web控制器回调
18 typealias cnWebControllerBackNavBlock = ()->Void 18 typealias cnWebControllerBackNavBlock = ()->Void
@@ -288,15 +288,15 @@ class CNWebView:UIView,WKNavigationDelegate, WKScriptMessageHandler{ @@ -288,15 +288,15 @@ class CNWebView:UIView,WKNavigationDelegate, WKScriptMessageHandler{
288 let total_fee = dataDic["total_fee"] as? Int 288 let total_fee = dataDic["total_fee"] as? Int
289 print("拉起苹果内购") 289 print("拉起苹果内购")
290 290
291 - //苹果内购暂时报错 应用packet无效  
292 -// CNLivePayCostModule.showApplePayViw(withParamDict: dataDic, fromVC: currentViewController()!) {[weak self] result in  
293 -// if result == CNLivePayCostTypeResultSucc{  
294 -// self?.bridge?.callHandler("wjjHtmlPullAppPayCallback", data: ["orderId":orderId,"payStatus":"0"], responseCallback: { responseData in  
295 -// print("succ")  
296 -// })  
297 -// }  
298 -//  
299 -// } 291 + //苹果内购暂时报错 验证失败支付失败
  292 + CNLivePayCostModule.showApplePayViw(withParamDict: dataDic, fromVC: currentViewController()!) {[weak self] result in
  293 + if result == CNLivePayCostTypeResultSucc{
  294 + self?.bridge?.callHandler("wjjHtmlPullAppPayCallback", data: ["orderId":orderId,"payStatus":"0"], responseCallback: { responseData in
  295 + print("succ")
  296 + })
  297 + }
  298 +
  299 + }
300 300
301 }) 301 })
302 302
metaCode/Classes/Other/AppDelegate.swift
@@ -16,6 +16,7 @@ import JFHeroBrowser @@ -16,6 +16,7 @@ import JFHeroBrowser
16 16
17 17
18 @main 18 @main
  19 +
19 class AppDelegate: UIResponder, UIApplicationDelegate { 20 class AppDelegate: UIResponder, UIApplicationDelegate {
20 var window: UIWindow? 21 var window: UIWindow?
21 22
@@ -48,7 +49,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -48,7 +49,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
48 49
49 //设置APP环境 50 //设置APP环境
50 CNLiveMCEnvironmentManager.shared.setupEnvironment(environment: .production) 51 CNLiveMCEnvironmentManager.shared.setupEnvironment(environment: .production)
51 - CNLiveEnvironmentManager.setEnvironment(.productionAppStore) 52 + CNLiveEnvironmentManager.setMetaCodeEnvironment(.productionAppStore)
  53 +
  54 + CNLivePaySDK.sharedCNLivePayManager().registerApp(CNLiveMCEnvironmentManager.shared.appId_wjj, appKey: CNLiveMCEnvironmentManager.shared.appKey_wjj, isTestEnvironment: false)
52 55
53 window = UIWindow.init(frame: UIScreen.main.bounds) 56 window = UIWindow.init(frame: UIScreen.main.bounds)
54 window?.backgroundColor = KVCBackgroupColor 57 window?.backgroundColor = KVCBackgroupColor