调试通畅firebaseremoteconfig
This commit is contained in:
parent
90fec41d2d
commit
70f2e078ff
@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
00290D1F2BC9125700B5244E /* remote_config_defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 00290D1E2BC9125700B5244E /* remote_config_defaults.plist */; };
|
||||||
003624662BA3F0AB0080D014 /* ZZHImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 003624652BA3F0AB0080D014 /* ZZHImageExtension.swift */; };
|
003624662BA3F0AB0080D014 /* ZZHImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 003624652BA3F0AB0080D014 /* ZZHImageExtension.swift */; };
|
||||||
005580782B9F1525004B9567 /* ZZHHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 005580772B9F1525004B9567 /* ZZHHelper.swift */; };
|
005580782B9F1525004B9567 /* ZZHHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 005580772B9F1525004B9567 /* ZZHHelper.swift */; };
|
||||||
006B61C72BBA499D003FCB49 /* SKUPay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006B61C62BBA499D003FCB49 /* SKUPay.swift */; };
|
006B61C72BBA499D003FCB49 /* SKUPay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006B61C62BBA499D003FCB49 /* SKUPay.swift */; };
|
||||||
@ -112,6 +113,7 @@
|
|||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
00290D1E2BC9125700B5244E /* remote_config_defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = remote_config_defaults.plist; sourceTree = "<group>"; };
|
||||||
003624652BA3F0AB0080D014 /* ZZHImageExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHImageExtension.swift; sourceTree = "<group>"; };
|
003624652BA3F0AB0080D014 /* ZZHImageExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHImageExtension.swift; sourceTree = "<group>"; };
|
||||||
005580772B9F1525004B9567 /* ZZHHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHHelper.swift; sourceTree = "<group>"; };
|
005580772B9F1525004B9567 /* ZZHHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHHelper.swift; sourceTree = "<group>"; };
|
||||||
006B61C62BBA499D003FCB49 /* SKUPay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKUPay.swift; sourceTree = "<group>"; };
|
006B61C62BBA499D003FCB49 /* SKUPay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKUPay.swift; sourceTree = "<group>"; };
|
||||||
@ -479,6 +481,7 @@
|
|||||||
AF2120932B4E7F1A00400B7F /* Main.storyboard */,
|
AF2120932B4E7F1A00400B7F /* Main.storyboard */,
|
||||||
AF2120962B4E7F1C00400B7F /* Assets.xcassets */,
|
AF2120962B4E7F1C00400B7F /* Assets.xcassets */,
|
||||||
00C665722BAA81F900C309C3 /* GoogleService-Info.plist */,
|
00C665722BAA81F900C309C3 /* GoogleService-Info.plist */,
|
||||||
|
00290D1E2BC9125700B5244E /* remote_config_defaults.plist */,
|
||||||
AF2120982B4E7F1C00400B7F /* LaunchScreen.storyboard */,
|
AF2120982B4E7F1C00400B7F /* LaunchScreen.storyboard */,
|
||||||
AF21209B2B4E7F1C00400B7F /* Info.plist */,
|
AF21209B2B4E7F1C00400B7F /* Info.plist */,
|
||||||
00EB2D012BA2D14700924D84 /* Localizable.strings */,
|
00EB2D012BA2D14700924D84 /* Localizable.strings */,
|
||||||
@ -694,6 +697,7 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
00290D1F2BC9125700B5244E /* remote_config_defaults.plist in Resources */,
|
||||||
00EB2D022BA2D15700924D84 /* Localizable.strings in Resources */,
|
00EB2D022BA2D15700924D84 /* Localizable.strings in Resources */,
|
||||||
AF21209A2B4E7F1C00400B7F /* LaunchScreen.storyboard in Resources */,
|
AF21209A2B4E7F1C00400B7F /* LaunchScreen.storyboard in Resources */,
|
||||||
AF2120972B4E7F1C00400B7F /* Assets.xcassets in Resources */,
|
AF2120972B4E7F1C00400B7F /* Assets.xcassets in Resources */,
|
||||||
|
|||||||
@ -20,17 +20,18 @@ import Firebase
|
|||||||
import FirebaseCore
|
import FirebaseCore
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import FacebookCore
|
import FacebookCore
|
||||||
|
import FirebaseRemoteConfig
|
||||||
@main
|
@main
|
||||||
|
|
||||||
|
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
var remoteConfig:FirebaseRemoteConfig.RemoteConfig?
|
||||||
var window: UIWindow?
|
var window: UIWindow?
|
||||||
// var root:RootManager?
|
// var root:RootManager?
|
||||||
var newWindow:UIWindow?
|
var newWindow:UIWindow?
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
|
||||||
FirebaseApp.configure()
|
configureFireBase()
|
||||||
|
|
||||||
do {
|
do {
|
||||||
try AVAudioSession.sharedInstance().setActive(true)
|
try AVAudioSession.sharedInstance().setActive(true)
|
||||||
@ -42,30 +43,37 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
|
|
||||||
|
|
||||||
SVProgressHUD.setDefaultStyle(.dark)
|
SVProgressHUD.setDefaultStyle(.dark)
|
||||||
|
|
||||||
// self.window = UIWindow(frame: UIScreen.main.bounds)
|
|
||||||
// self.window?.backgroundColor = UIColor.white
|
|
||||||
// self.window?.makeKeyAndVisible()
|
|
||||||
|
|
||||||
Analytics.logEvent("user_launch", parameters: ["type":"new"])
|
Analytics.logEvent("user_launch", parameters: ["type":"new"])
|
||||||
SKUPay.sharedInstance.requestProducts(productsIdentifiers: MemberShipModelItem.getProductsIDs())
|
SKUPay.sharedInstance.requestProducts(productsIdentifiers: MemberShipModelItem.getProductsIDs())
|
||||||
SKUPay.sharedInstance.setUpUserInfo()
|
SKUPay.sharedInstance.setUpUserInfo()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func configureFireBase() {
|
||||||
|
FirebaseApp.configure()
|
||||||
|
remoteConfig = FirebaseRemoteConfig.RemoteConfig.remoteConfig()
|
||||||
|
let settings = RemoteConfigSettings()
|
||||||
|
settings.minimumFetchInterval = 0
|
||||||
|
remoteConfig!.configSettings = settings
|
||||||
|
remoteConfig!.setDefaults(fromPlist: "remote_config_defaults")
|
||||||
|
|
||||||
|
remoteConfig!.fetch {[weak self] (status, error) -> Void in
|
||||||
|
if status == .success {
|
||||||
|
// print("Config fetched!")
|
||||||
|
self?.remoteConfig?.activate { changed, error in
|
||||||
|
// print("Config fetched! e:\(error)")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// print("Config not fetched")
|
||||||
|
// print("Error: \(error?.localizedDescription ?? "No error available.")")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// let zh = remoteConfig?.configValue(forKey: "menuParams")
|
||||||
|
// print("zh:\(zh)")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// func exceptionLogWithData() {
|
|
||||||
// CopyCrashHandler.setDefaultHandler()
|
|
||||||
// let str = CopyCrashHandler.getdataPath()
|
|
||||||
// let data = NSData.init(contentsOfFile: str)
|
|
||||||
// if data != nil {
|
|
||||||
// let crushStr:String? = String.init(data: data! as Data, encoding: String.Encoding.utf8)
|
|
||||||
// Analytics.logEvent("app_crash", parameters: ["crashInfo":crushStr ?? ""])
|
|
||||||
//
|
|
||||||
// CopyCrashHandler.cleanCrashInfo()
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//前后台切换--进入前台
|
//前后台切换--进入前台
|
||||||
|
|||||||
8
SwiftProject/SwiftProject/remote_config_defaults.plist
Normal file
8
SwiftProject/SwiftProject/remote_config_defaults.plist
Normal file
@ -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>menuParams</key>
|
||||||
|
<string>{"contactConfig":{"default":[{"icon":"xxxxxx","title":"wecht","url":""},{"icon":"xxxxxx","title":"wecht","url":""}],"zh":[{"icon":"xxxxxx","title":"wecht","url":"ffff"},{"icon":"xxxxxx","title":"wecht","url":"xxx"}]}}</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Loading…
Reference in New Issue
Block a user