gpt4 book ai didi

ios - NW Pusher 推送有效载荷 - iOS Swift

转载 作者:搜寻专家 更新时间:2023-11-01 05:38:49 26 4
gpt4 key购买 nike

我遇到了错误

'无法使用类型参数列表(NSString, token :NSString,标识符:int32 错误:inout NSError?)调用推送负载'

下一行

    var error:NSError? = nil
var Pusher:NWPusher = NWPusher.connectWithPKCS12Data(PKS12,password:"as",error: &error)
println(Pusher)
var payLoad:NSString = "{\"aps\":{\"alert\":\"Testing From Swift App\"}}";
var token:NSString = "token string here"
var PayLoaderror:NSErrorPointer? = nil
var pushed:Bool = Pusher.pushPayload(payLoad, token: token, identifier:rand() ,error: &error)

最佳答案

var error:NSError? = nil 
var Pusher:NWPusher = NWPusher.connectWithPKCS12Data(PKS12,password:"as",error: &error)
println(Pusher)
var payLoad:NSString = "{\"aps\":{\"alert\":\"Testing From Swift App\"}}"
var token:NSString = "Token here"

// here is my new line of code
//
// also make certain Int32 is capitalized; case sensitivity matters!
let identifier = rand() as Int32

let pushed = Pusher.pushPayload(payLoad, token: token, identifier: identifier ,error: &error)

关于ios - NW Pusher 推送有效载荷 - iOS Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33435503/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com