添加firebase读取配置信息

This commit is contained in:
bluesea 2024-04-12 19:30:06 +08:00
parent d97351db90
commit bd6668b6c1
21 changed files with 143 additions and 28 deletions

View File

@ -48,4 +48,5 @@ pod 'FirebaseFirestore'
pod 'FacebookCore'
pod 'FirebaseRemoteConfig'
pod 'KeychainAccess'
pod 'SDWebImage'
end

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_1597880421.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1597880421@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1597880421@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_1597880413.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1597880413@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1597880413@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_1597880409.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1597880409@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1597880409@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_1597880414.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1597880414@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1597880414@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

View File

@ -135,24 +135,44 @@ class MenuVC: BaseController,UITableViewDelegate,UITableViewDataSource {
//Share VPCamera And Feedback,keyimagetitle
private func getDatasourceOneSection () -> [[String:Any]] {
return [
["image":UIImage(named: "")!, "title":NSLocalizedString("v1.5_share vpcamera", comment: "")],
["image":UIImage(named: "")!, "title":NSLocalizedString("v1.5_feedback", comment: "")]
["image":UIImage(named: "menuvc_sharevpcamera")!, "title":NSLocalizedString("v1.5_share vpcamera", comment: "")],
["image":UIImage(named: "menuvc_feedback")!, "title":NSLocalizedString("v1.5_feedback", comment: "")]
]
}
//Privacy Policy And Terms of Service,keyimagetitle
private func getDatasourceTwoSection () -> [[String:Any]] {
return [
["image":UIImage(named: "")!, "title":NSLocalizedString("v1.5_privacy policy", comment: "")],
["image":UIImage(named: "")!, "title":NSLocalizedString("v1.5_terms of service", comment: "")]
["image":UIImage(named: "menuvc_privacy")!, "title":NSLocalizedString("v1.5_privacy policy", comment: "")],
["image":UIImage(named: "menuvc_terms")!, "title":NSLocalizedString("v1.5_terms of service", comment: "")]
]
}
//key imagetitleurl
private func getDatasourceThreeSection () -> [[String:Any]] {
let url = URL(string: "XXXXXX")
let config = FirebaseRemoteConfig.RemoteConfig.remoteConfig()
let menuParams = config.configValue(forKey: "menuParams")
guard let dicInfo = menuParams.jsonValue as? [String:Any] else {
return [["":""]]
}
guard let contactConfig = dicInfo["contactConfig"] as? [String:Any] else {
return [["":""]]
}
return [
["image":UIImage(named: ""), "title":"title", "url":"url"]
]
var localConfig = contactConfig[NSLocalizedString("menu_lang", comment: "")] as? [[String:Any]]
if localConfig == nil {
localConfig = contactConfig["default"] as? [[String:Any]]
}
var dataDictionary:[[String:Any]] = []
localConfig?.forEach({ item in
let iconUrl = item["icon"] as! String
let title = item["title"] as! String
let jumpUrl = item["url"] as! String
dataDictionary.append(["image":UIImage(named: ""), "title":item["title"] as! String, "url":item["url"] as! String])
})
return dataDictionary
}
//MARK: - TableViewDelegate and DataSource

View File

@ -122,13 +122,14 @@
"v1.5_negative" = "Negative";
"v1.5_feedbackdesc" = "Do you like VPCamera?\nPlease rate a Five star or give a feed\n back to us";
//V1.5版本,用于功能集合页
"v1.5_share vpcamera" = "Share VPCamera"
"v1.5_feedback" = "Feedback"
"v1.5_privacy policy" = "Privacy Policy"
"v1.5_terms of service" = "Terms of Service"
"v1.5_contact us" = "Contact us"
"v1.5_problem/suggestion placeholder" = "Please let us kno'w your prablems or suggestions. Our service team will deal with it soon."
"v1.5_problem/suggestion title" = "Problem/Suggestion description"
"v1.5_contact information placeholder" = "Please @xxxx.com"
"v1.5_contact information title" = "Contact information"
"v1.5_submit" = "Submit"
"v1.5_share vpcamera" = "Share VPCamera";
"v1.5_feedback" = "Feedback";
"v1.5_privacy policy" = "Privacy Policy";
"v1.5_terms of service" = "Terms of Service";
"v1.5_contact us" = "Contact us";
"v1.5_problem/suggestion placeholder" = "Please let us kno'w your prablems or suggestions. Our service team will deal with it soon.";
"v1.5_problem/suggestion title" = "Problem/Suggestion description";
"v1.5_contact information placeholder" = "Please @xxxx.com";
"v1.5_contact information title" = "Contact information";
"v1.5_submit" = "Submit";
"menu_lang" = "en";

View File

@ -118,13 +118,14 @@
"右侧亮度循环按键" ="右侧亮度循环按键\n长按 3s 切换 HSBS\n长按 7s 切换 FSBS";
//V1.5版本,用于功能集合页
"v1.5_share vpcamera" = "分享 VPCamera"
"v1.5_feedback" = "反馈意见"
"v1.5_privacy policy" = "隐私政策"
"v1.5_terms of service" = "服务条款"
"v1.5_contact us" = "联系我们"
"v1.5_problem/suggestion title" = "问题/建议描述"
"v1.5_problem/suggestion placeholder" = "请告知我们您的问题或建议。我们的服务团队将尽快处理。"
"v1.5_contact information title" = "联系信息"
"v1.5_contact information placeholder" = "请输入 @xxxx.com"
"v1.5_submit" = "提交"
"v1.5_share vpcamera" = "分享 VPCamera";
"v1.5_feedback" = "反馈意见";
"v1.5_privacy policy" = "隐私政策";
"v1.5_terms of service" = "服务条款";
"v1.5_contact us" = "联系我们";
"v1.5_problem/suggestion title" = "问题/建议描述";
"v1.5_problem/suggestion placeholder" = "请告知我们您的问题或建议。我们的服务团队将尽快处理。";
"v1.5_contact information title" = "联系信息";
"v1.5_contact information placeholder" = "请输入 @xxxx.com";
"v1.5_submit" = "提交";
"menu_lang" = "zh";