Classes
The following classes are available globally.
-
Representation of an error returned from the server.
See moreDeclaration
Swift
public final class AlertingApiError: NSObject
-
Group of perils. Users can register to this groups to be notified about their perils.
To get all peril groups for an organisation call
See moregetAllGroups
from AlertingService instance, after it was set up with cliend id and secret.Declaration
Swift
public final class PerilGroup: NSObject
-
Geographical position described by latitude and longitude coordinates.
See moreDeclaration
Swift
public final class Location: NSObject
-
Use an entity of this class to get access to all SDKs key functionality.
An AlertingService object supports:
- TWC Alerting service authentication
- Creating, updating, deleting assets, asset registrations, viewing of available peril groups and perils
- Tracking and updating user’s location automatically (follow me)
To configure and start using an
AlertingService
object:- Instantiate new
AlertingService
object - Call
setup(clientId: clientSecret: launchOptions:)
in yourAppDelegate's application(_ application: didFinishLaunchingWithOptions:)
- Create an asset with
create(_ asset)
call - Retrieve available peril groups with
getAllGroups()
call - Prepare an
AssetNotification
object with one of two types (email
orsms
) and address (email address or phone number) - Prepare an
AssetRegistration
object with your asset’s id, selected peril groups and preparedAssetNotification
object - Register an asset for selected groups with
registerAsset(_ registration)
call and pass preparedAssetRegistrationObject
into it - Call
followMe()
to start tracking user location automatically, or retrive the your lastAsset
object fromgetCurrentAsset()
call, update its location and callupdate(_ asset)
to update its location manually.
Note
Do not foget to stop tracking user location by callingsetStaticMode()
when it is no longer needed.Declaration
Swift
public class AlertingService: NSObject
-
The results of automatic asset’s location updates. They are sent in AlertingServiceNotification and can be retrieved by accessing notification’s userInfo[
See morelog
].Declaration
Swift
public final class AssetLog: NSObject, Decodable
-
Natural event that
Peril groups
can contain. If users are registered to aPeril groups
, they will be notified about upcoming perils nearby them or their specified location.To get all perils from a group, call getAllPerilsForPerilGroup from AlertingService instance, after it was set up with cliend id and secret.
See moreDeclaration
Swift
public final class Peril: NSObject
-
This class may represent user, property or any entity that can be described with location. You can subscribe your
See moreAsset
object to receive notifications of upcoming weather events nearby it.Declaration
Swift
public final class Asset: NSObject
-
Information about asset’s subscription. Includes notifications delivery address and peril groups subscribed to.
See moreDeclaration
Swift
public final class AssetRegistration: NSObject