小编Vis*_*mbo的帖子

找到了满足“Firebase/Functions”依赖性的规范,但它们需要更高的最低部署目标

我试图安装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)

deployment ios cocoapods firebase google-cloud-functions

8
推荐指数
4
解决办法
1万
查看次数

如何在 ios 中将数据类型声明为 Timestamp - swift

我是一名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)

timestamp firebase swift google-cloud-firestore

5
推荐指数
1
解决办法
9922
查看次数

使用电话号码身份验证的令牌不匹配 - iOS

我正在尝试使用 firebase 使用电话号码身份验证登录帐户。

最初,我在我的设备上部署了该应用程序,并且运行良好。但是当我尝试将应用程序部署到另一台设备时,它会抛出错误Token Mismatch

我搜索了几个答案,stackoverflow然后找到了这个答案,然后我遵循了,但它对我不起作用。

我已经检查了以下内容:

  1. 确保我将有效的开发和生产 APNS 证书上传到 Firebase 仪表板的“项目设置”>“云消息传递”下。(我的 APNS 证书有效期到明年)。
  2. 在 Xcode 的 .entitlements 文件中,确保 APS 环境值设置为“开发”或“生产”,具体取决于您的测试情况。(我也检查过)。
  3. 最后(这就是我所缺少的),检查您的 AppDelegate.swift 和 for 方法内部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 设备时,它仍然给我错误。我想知道为什么?

xcode token ios swift firebase-authentication

3
推荐指数
2
解决办法
4769
查看次数

urlSession 从远程 url 下载失败 - 出现 CFNetworkDownload_gn6wzc.tmp

我试图使用从远程 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

2
推荐指数
1
解决办法
3399
查看次数

NSLayoutConstraint没有成员'Attribute'

我试图在下面转换swift代码

NSLayoutConstraint.Attribute.height
Run Code Online (Sandbox Code Playgroud)

我正在使用SkeletonView,它在执行时抛出了我的错误.

我无法找到新的替换语法

类型'NSLayoutConstraint'没有成员'属性'

ios nslayoutconstraint swift

2
推荐指数
1
解决办法
718
查看次数

Flutter - 底部溢出像素数

我正在使用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)

android widget ios flutter flutter-layout

2
推荐指数
1
解决办法
9009
查看次数