Table of Contents
Installation
CocoaPods
- Add
source 'https://github.com/CocoaPods/Specs.git'
to yourPodfile
- Add
pod 'SafehealthPush', '~> 0.1.0'
to yourPodfile
Your Podfile
should look like:
# Podfile
source 'https://github.com/CocoaPods/Specs.git'
target 'Example' do
pod 'SafehealthPush', '~> 0.1.0'
end
- 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
String
userId: Identifies the user to whom the device is associated.
String
deviceId: Identifies the device to be deleted.
🌐 Endpoint
/users/{userId}/devices/{deviceId}
DELETE
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
String
userId: Identifies the user for whom to retrieve devices.
Int
page: Int
limit: 🔄 Return
🌐 Endpoint
/users/{userId}/devices
GET
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
String
userId: Identifies the user to whom this device will be associated.
Device
device: 🔄 Return
🌐 Endpoint
/users/{userId}/devices
POST
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
String
id: Date
createdAt: Date
updatedAt: String
deviceId: String
appVersion: String
deviceModel: String
deviceToken: String
deviceType: String
idfaId: Bool
isLoggedIn: String
osVersion: String
voipToken: String
userId: String
tenantId: String
userUUID: String
nationalHealthId: String
language: 🔄 Return
🌐 Endpoint
/device
POST
safehealthpush.userDevice.delete
Deletes UserDevice entity by device token.
🛠️ Usage
let deviceToken = "deviceToken_example"
let deleteResponse = try await safehealthpush.userDevice.delete(
deviceToken: deviceToken
)
⚙️ Parameters
String
deviceToken: Identifying token passed when creating UserDevice.
🔄 Return
🌐 Endpoint
/device
DELETE
Author
This TypeScript package is automatically generated by Konfig