【发布时间】:2016-05-27 17:06:44
【问题描述】:
您好,我打算设置一个函数,以便在我需要触发该函数时从应用程序向每个下载的应用程序发送推送通知;
func notification(debug:Bool,content:String){
let pushContent:[NSObject : AnyObject] = ["app_id" : [""], "contents": ["en": content]]
OneSignal.postNotification(pushContent)
}
错误是对成员“postNotification”的模糊引用
我查看了 API 参考,他们给出了一个这样的示例,但效果不佳
OneSignal.postNotification(["contents": ["en": "Test Message"], "include_player_ids": ["3009e210-3166-11e5-bc1b-db44eb02b120"]])
error is '(dictionaryLiteral: (NSObject, AnyObject), (NSObject, AnyObject))' 不能转换为 '(dictionaryLiteral: (NSString, NSObject)...)',元组有不同数量的元素
我怎样才能使这项工作?
是的,它是最新的 使用 OneSignal (1.13.2)
【问题讨论】:
标签: ios swift api push-notification onesignal