SafehealthPush 0.1.5

SafehealthPush 0.1.5

Maintained by Konfig Publisher.



  • By
  • safehealth.me

Visit Safe Health

Safe Health

Send push notifications to a user's device

Health Check UI

CocoaPods

Table of Contents

Installation

CocoaPods

  1. Add source 'https://github.com/CocoaPods/Specs.git' to your Podfile
  2. Add pod 'SafehealthPush', '~> 0.1.0' to your Podfile

Your Podfile should look like:

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

target 'Example' do
  pod 'SafehealthPush', '~> 0.1.0'
end
  1. Run 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.

Getting Started

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
)

Reference

safehealthpush.device.delete

Deletes the identified device from the specified user's devices.

🛠️ Usage

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

⚙️ Parameters

userId: String

Identifies the user to whom the device is associated.

deviceId: String

Identifies the device to be deleted.

🌐 Endpoint

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

🔙 Back to Table of Contents


safehealthpush.device.list

Retrieves a pageable list of devices associated with the specified user.

🛠️ Usage

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

⚙️ Parameters

userId: String

Identifies the user for whom to retrieve devices.

page: Int
limit: Int

🔄 Return

DeviceListResponse

🌐 Endpoint

/users/{userId}/devices GET

🔙 Back to Table of Contents


safehealthpush.device.store

Stores a new device associated with the specified user. If a device with any matching token(s) already exists for that user, it will be removed.

🛠️ Usage

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
)

⚙️ Parameters

userId: String

Identifies the user to whom this device will be associated.

device: Device

🔄 Return

DeviceCreateResponse

🌐 Endpoint

/users/{userId}/devices POST

🔙 Back to Table of Contents


safehealthpush.userDevice.create

Creates a UserDevice entity.

🛠️ Usage

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
)

⚙️ Parameters

id: String
createdAt: Date
updatedAt: Date
deviceId: String
appVersion: String
deviceModel: String
deviceToken: String
deviceType: String
idfaId: String
isLoggedIn: Bool
osVersion: String
voipToken: String
userId: String
tenantId: String
userUUID: String
nationalHealthId: String
language: String

🔄 Return

UserDevice

🌐 Endpoint

/device POST

🔙 Back to Table of Contents


safehealthpush.userDevice.delete

Deletes UserDevice entity by device token.

🛠️ Usage

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

⚙️ Parameters

deviceToken: String

Identifying token passed when creating UserDevice.

🔄 Return

UserDevice

🌐 Endpoint

/device DELETE

🔙 Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig