XU XUv0.8.8
EN

API

#net/apns

import: #net/apns

counts: 1 函数, 2 方法, 2 类型, 2 常量, 0 方法集

标准库包 `#net/apns`。

const host_prod

XuAPI
pub const host_prod = "api.push.apple.com"

用途

公开常量 `host_prod`。 值为 `"api.push.apple.com"`

参数

无

const host_sandbox

XuAPI
pub const host_sandbox = "api.sandbox.push.apple.com"

用途

公开常量 `host_sandbox`。 值为 `"api.sandbox.push.apple.com"`

参数

无

struct Client

XuAPI
pub struct Client {

}

用途

公开结构体 `Client`。

参数

无

struct PushResult

XuAPI
pub struct PushResult {
    pub status int
    pub apns_id string
    pub reason string
    pub ok bool
}

用途

公开结构体 `PushResult`。

参数

status int
字段(int)
apns_id string
字段(string)
reason string
字段(string)
ok bool
字段(bool)

connect

XuAPI
pub fn connect(production bool, team_id string, key_id string, private_key string, topic string) Client

用途

connect,返回 Client。失败时 throw。

参数

production bool
production(bool)
team_id string
team_id(string)
key_id string
key_id(string)
private_key string
private_key(string)
topic string
topic(string)

返回

Client — 该类型的值

(&mut Client) push

XuAPI
pub fn (c &mut Client) push(device_token string, payload_json string) PushResult

用途

`&mut Client` 上的方法:压入。

参数

c &mut Client
接收者 &mut Client(可变借用)
device_token string
device_token(string)
payload_json string
payload_json(string)

返回

PushResult — 该类型的值

(&mut Client) close

XuAPI
pub fn (c &mut Client) close()

用途

`&mut Client` 上的方法:关闭资源。

参数

c &mut Client
接收者 &mut Client(可变借用)