ios - 无法弄清楚为什么我收到错误 "PFPush does not have a member named sendPushInBackground"

标签 ios swift parse-platform push-notification

我从解析文档中复制了这个,但在最后一行不断收到错误“PFPush 没有名为 sendPushInBackground 的成员”。我不知道为什么

        let pushQuery = PFInstallation.query()
        pushQuery.whereKey("deviceType", equalTo: "ios")

        let push = PFPush()
        push.setQuery(pushQuery) // Set our Installation query
        push.setMessage("Willie Hayes injured by own pop fly.")
        push.sendPushInBackground()

最佳答案

来自 PARSE DOC:v1.2.21 — 2014 年 8 月 22 日

“从这个版本开始,您需要将 Bolts.framework(和 ParseFacebookUtils.framework,如果您的应用程序与 Facebook SDK 交互)拖到您的 Xcode 项目文件夹目标中。两者都位于 Parse SDK 下载中。”

因此,如果您在 Swift 中使用它...在您拖动 Bolt 框架之后,您还必须添加这个“#import”

#import <Bolts/Bolts.h>在你的...-Bridging-Header.h

编码愉快!

关于ios - 无法弄清楚为什么我收到错误 "PFPush does not have a member named sendPushInBackground",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28562623/

相关文章:

ios - 使用应用程序组将数据从 Watch 传递到 iPhone

swift - WKWebView无法拖动Element

ios - 如何使根导航栏透明,但子导航栏不透明?

swift - 带有 Parse 对象的 UISearchController?

objective-c - 为什么我不能在 iOS 中删除 NSMutableArray 的所有对象?

ios - 以编程方式使用自动布局约束在 UIView Swift 2.3 iOS10 中将 UIImageView 居中

iPhone - 用压缩的 plist 文件的内容填充一个数组

ios - Amplitude 未记录 "applicationWillTerminate"iOS 中写入的事件

Swift [错误] : Object not found.(代码 : 101, 版本 : 1. 12.0)

ios - 如何将保存的图像从 Parse.com 提取到我的应用程序中