从 OS X/Mac 发送推送通知 [英] Sending a PUSH notification from OS X/Mac
问题描述
是否可以使用解析 OS X SDK 来结束推送通知?
Is it possible to use the parse OS X SDK to end push notification?
我一添加:
#import <ParseOSX/PFInstallation.h>
#import <ParseOSX/PFPush.h>
我开始收到构建错误:
体系结构 x86_64 的未定义符号:_OBJC_CLASS_$_PFInstallation",引用自:SendMessageController.o 中的 objc-class-ref_OBJC_CLASS_$_PFPush",引用自:SendMessageController.o 中的 objc-class-refld:找不到架构 x86_64 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_PFInstallation", referenced from: objc-class-ref in SendMessageController.o "_OBJC_CLASS_$_PFPush", referenced from: objc-class-ref in SendMessageController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
推荐答案
PFPush
和 PFInstallation
在 OS X 上不可用.从文档(从 SDK 1.4.2):
PFPush
and PFInstallation
are not available on OS X. From the documentation (as of SDK 1.4.2):
该类目前仅适用于 iOS.在 OS X 上运行的 Parse 应用程序没有 PFInstallation,因为它们无法接收推送通知.
This class is currently for iOS only. There is no PFInstallation for Parse applications running on OS X, because they cannot receive push notifications.
如果您想发送推送通知,则必须在 OS X 应用程序中使用 Cloud Code 或 REST-API.请参阅此处的语法 解析文档 并使用例如NSURLSession
和 NSURLSessionTask
用于发出请求.
If you want to send a push notification, you'll have to use Cloud Code or the REST-API from within your OS X application. See here for the syntax Parse documentation and use e.g. NSURLSession
and NSURLSessionTask
for making the request.
这篇关于从 OS X/Mac 发送推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!