SafehealthPush 0.1.5

SafehealthPush 0.1.5

Konfig Publisher 维护。



  • safehealth.me

Visit Safe Health

Safe Health

将推送通知发送到用户的设备

健康管理 UI

CocoaPods

目录

安装

CocoaPods

  1. source 'https://github.com/CocoaPods/Specs.git' 添加到您的 Podfile
  2. pod 'SafehealthPush', '~> 0.1.0' 添加到您的 Podfile

您的 Podfile 应该是这样的

# Podfile
source 'https://github.com/CocoaPods/Specs.git'

target 'Example' do
  pod 'SafehealthPush', '~> 0.1.0'
end
  1. 运行 pod install
❯ pod install
Analyzing dependencies
Downloading dependencies
Installing SafehealthPush 0.1.0
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.

入门

import SafehealthPush

let safehealthpush = SafehealthPushClient(
    identityAccessToken: "AUTHORIZATION",
    safeAccount: "X_SF_ACCOUNT",
    safeTenant: "X_SF_TENANT"
    // Defining the base path is optional and defaults to https://api.dev-1.sf.safecdx.io/v1beta/notification-push
    // basePath: "https://api.dev-1.sf.safecdx.io/v1beta/notification-push"
)

let userId = UUID().uuidString
let deviceId = UUID().uuidString
let deleteResponse = try await safehealthpush.device.delete(
    userId: userId,
    deviceId: deviceId
)

参考

safehealthpush.device.delete

从指定用户的设备中删除指定的设备。

🛠️ 使用

let userId = UUID().uuidString
let deviceId = UUID().uuidString
let deleteResponse = try await safehealthpush.device.delete(
    userId: userId,
    deviceId: deviceId
)

⚙️ 参数

userId: 字符串

用于标识与该设备关联的用户。

deviceId: 字符串

标识要删除的设备。

🌐 端点

/users/{userId}/devices/{deviceId} DELETE

🔙 返回目录


safehealthpush.device.list

获取指定用户关联的设备分页列表。

🛠️ 使用方法

let userId = UUID().uuidString
let page = 987
let limit = 987
let listResponse = try await safehealthpush.device.list(
    userId: userId,
    page: page,
    limit: limit
)

⚙️ 参数

userId: 字符串

标识要检索设备的用户。

page: 整数
limit: 整数

🔄 返回

DeviceListResponse

🌐 端点

/users/{userId}/devices GET

🔙 返回目录


safehealthpush.device.store

存储与指定用户关联的新设备。如果该用户已存在任何匹配令牌的设备,则将删除该设备。

🛠️ 使用方法

let userId = UUID().uuidString
let device = Device(
    id: "id_example",
    createdAt: Date(),
    updatedAt: Date(),
    platform: Platform.unknown,
    web: Web(
        operatingSystem: OperatingSystem.unknown,
        browserName: BrowserName.unknown,
        hostname: "hostname_example",
        defaults: WebPushDefaults(
            channels: WebChannels(
                firebaseCloudMessaging: WebFirebaseCloudMessaging(
                    projectId: "projectId_example",
                    appId: "appId_example",
                    token: "token_example"
                )
            )
        )
    ),
    mobile: Mobile(
        os: MobileOperatingSystem.appleIos,
        ios: AppleIos(
            bundleId: "bundleId_example",
            teamId: "teamId_example",
            signingCertificateType: SigningCertificate.development,
            channels: AppleIosChannels(
                simpleNotificationService: AppleSimpleNotificationService(
                    apnsVoip: ApplePushNotificationServiceVoIp(
                        applicationArn: "applicationArn_example",
                        token: "token_example"
                    )
                ),
                firebaseCloudMessaging: AppleFirebaseCloudMessaging(
                    projectId: "projectId_example",
                    applicationId: "applicationId_example",
                    token: "token_example"
                )
            )
        ),
        android: Android(
            channels: AndroidChannels(
                firebaseCloudMessaging: AndroidFirebaseCloudMessaging(
                    projectId: "projectId_example",
                    applicationId: "applicationId_example",
                    token: "token_example"
                )
            )
        )
    )
)
let storeResponse = try await safehealthpush.device.store(
    userId: userId,
    device: device
)

⚙️ 参数

userId: 字符串

用于识别将与设备关联的用户。

设备: Device

🔄 返回

DeviceCreateResponse

🌐 端点

/users/{userId}/devices POST

🔙 返回目录


safehealthpush.userDevice.create

创建UserDevice实体。

🛠️ 用法

let id = "id_example"
let createdAt = Date()
let updatedAt = Date()
let deviceId = "deviceId_example"
let appVersion = "appVersion_example"
let deviceModel = "deviceModel_example"
let deviceToken = "deviceToken_example"
let deviceType = "deviceType_example"
let idfaId = "idfaId_example"
let isLoggedIn = true
let osVersion = "osVersion_example"
let voipToken = "voipToken_example"
let userId = "userId_example"
let tenantId = "tenantId_example"
let userUUID = "userUUID_example"
let nationalHealthId = "nationalHealthId_example"
let language = "language_example"
let createResponse = try await safehealthpush.userDevice.create(
    id: id,
    createdAt: createdAt,
    updatedAt: updatedAt,
    deviceId: deviceId,
    appVersion: appVersion,
    deviceModel: deviceModel,
    deviceToken: deviceToken,
    deviceType: deviceType,
    idfaId: idfaId,
    isLoggedIn: isLoggedIn,
    osVersion: osVersion,
    voipToken: voipToken,
    userId: userId,
    tenantId: tenantId,
    userUUID: userUUID,
    nationalHealthId: nationalHealthId,
    language: language
)

⚙️ 参数

id: 字符串
createdAt: 日期
updatedAt: 日期
deviceId: 字符串
appVersion: 字符串
deviceModel: 字符串
deviceToken: 字符串
deviceType: 字符串
idfaId: 字符串
是否登录: 布尔型
操作系统版本: 字符串
Voice-over-IP令牌: 字符串
用户ID: 字符串
租户ID: 字符串
userUUID: String
nationalHealthId: String
language: String

🔄 返回

UserDevice

🌐 端点

/device POST

🔙 返回目录


safehealthpush.userDevice.delete

通过设备令牌删除UserDevice实体。

🛠️ 使用方法

let deviceToken = "deviceToken_example"
let deleteResponse = try await safehealthpush.userDevice.delete(
    deviceToken: deviceToken
)

⚙️ 参数

deviceToken: String

创建UserDevice时传递的标识令牌。

🔄 返回结果

UserDevice

🌐 端点

/device DELETE

🔙 返回目录


作者

此TypeScript包由Konfig自动生成