我试图安装pod 'Firebase/Functions'但失败并出现以下错误:
`[!] CocoaPods 找不到 pod“Firebase/Functions”的兼容版本:在 Podfile 中:Firebase/Functions
Firebase/Functions找到了满足依赖性的规范,但它们需要更高的最低部署目标。`
这是我的 pod 文件
# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to
use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Messaging' ,'~> 4.6.0'
pod 'Firebase/Storage'
pod 'Firebase/Functions'
pod 'GoogleMaps'
pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Phone'
pod …Run Code Online (Sandbox Code Playgroud) 我是一名iOS编程新手。我正在创建一个与Firestore. 在Firestore我创建的集合中,每个文档都包含许多字段。
我在我的文档中添加了Timestamp字段。当我创建模型时,xcode我如何声明我的变量,Timestamp因为我需要tableView基于Timestamp.
Timestamp看起来是这样Firestore的:
September 17, 2018 at 3:37:43 PM UTC+7
那么,我如何编写程序并获取当前的信息,Timestamp如所示Firestore
这是编程中的:
struct RecentCallModel {
var call_answered: Bool?
var call_extension: String?
var call_type: String?
var details: String?
var duration: String?
var title: String?
// How can i declare as Timestamp
var timestamp: ???
init(call_answered: Bool, call_extension: String, call_type: String, details: String , duration: String, timestamp: String, title: String) { …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 firebase 使用电话号码身份验证登录帐户。
最初,我在我的设备上部署了该应用程序,并且运行良好。但是当我尝试将应用程序部署到另一台设备时,它会抛出错误Token Mismatch。
我搜索了几个答案,stackoverflow然后找到了这个答案,然后我遵循了,但它对我不起作用。
我已经检查了以下内容:
didRegisterForRemoteNotificationsWithDeviceToken,将值从.sandboxto.prod或 to更改.unknown为让应用程序包根据您的配置文件确定要使用的令牌类型。这第三次我也改变了
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
print("==== This is device token ",token)
let data = Data(token.utf8)
Auth.auth().setAPNSToken(data, type: AuthAPNSTokenType.unknown)
Run Code Online (Sandbox Code Playgroud)
但当我在另一台设备上运行这个应用程序时,它总是会抛出该错误。
但是,当我注释这行代码// Auth.auth().setAPNSToken(data, type: AuthAPNSTokenType.unknown)然后运行该应用程序时,我取消注释该行代码Auth.auth().setAPNSToken(data, type: AuthAPNSTokenType.unknown),然后再次运行该应用程序,最后它起作用了。但遗憾的是,当我运行另一个 iOS 设备时,它仍然给我错误。我想知道为什么?
我试图使用从远程 url 下载文件urlSession。但是,当下载完成后,出现了一个意外的文件,名为“CFNetworkDownload_gn6wzc.tmp然后我无法使用uidocumentinteractioncontroller.该文件是什么?”打开该文件。如何解决这个问题。感谢您的回复。
这是消息
Your location is file:///Users/pisal/Library/Developer/CoreSimulator/Devices/26089E37-D4EA-49E5-8D45-BB7D9C52087D/data/Containers/Data/Application/767E966E-5954-41BA-B003-90E2D27C5558/Library/Caches/com.apple.nsurlsessiond/Downloads/com.SamboVisal.downloadTask/CFNetworkDownload_gn6wzc.tmp
这是我的示例代码:我通过此方法发送链接
@IBAction func startDownload(_ sender: Any) {
let url = URL(string: "http://www.tutorialspoint.com/swift/swift_tutorial.pdf")!
let task = DownloadManager.shared.activate().downloadTask(with: url)
task.resume()
}
Run Code Online (Sandbox Code Playgroud)
然后下载完成后:
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
debugPrint("Download finished: \(location)")
debugPrint("download task : \(downloadTask)")
ViewController().documentInteraction(location: location)
}
Run Code Online (Sandbox Code Playgroud)
当我试图打开时uidocumentinteractioncontroller
let documentDirectoryPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString
let destinationPath = documentDirectoryPath.appendingPathComponent("swift.pdf")
let destinationUrl = URL(fileURLWithPath: destinationPath)
do{
try FileManager.default.copyItem(at: locat, to: destinationUrl)
} …Run Code Online (Sandbox Code Playgroud) uidocumentinteraction nsurlsession nsurlsessiondownloadtask swift iosdeployment
我试图在下面转换swift代码
NSLayoutConstraint.Attribute.height
Run Code Online (Sandbox Code Playgroud)
我正在使用SkeletonView,它在执行时抛出了我的错误.
我无法找到新的替换语法
类型'NSLayoutConstraint'没有成员'属性'
我正在使用Expanded小部件及其子部件Container,并提供了宽度double.infinity。我正在尝试添加ListView作为子项,并且我想要从屏幕顶部到屏幕底部Container的高度。ListView虽然我的屏幕顶部已经有一个名为 的小部件BuildHeaderPage。所以,我希望小部件的高度Container从小部件的底部开始BuildHeaderPage到屏幕的底部。
下面是我的代码:
return Scaffold(
appBar: AppBar(
elevation: 0,
title: Text("Dry Cough"),
backgroundColor: bgroundHeaderColor,
actions: <Widget>[
IconButton(
icon: Icon(Icons.more_vert),
onPressed: () {},
)
],
),
resizeToAvoidBottomInset: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BuildHeaderPage(bgroundHeaderColor: bgroundHeaderColor),
Padding(
padding: new EdgeInsets.symmetric(vertical: 8, horizontal: 8),
child: Expanded(
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: kPrimaryColor.withOpacity(0.3),
),
child: ListView(
children: <Widget>[
ListTile(
onTap: () {},
title: …Run Code Online (Sandbox Code Playgroud)