Classes

The following classes are available globally.

  • Representation of an error returned from the server.

    See more

    Declaration

    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 getAllGroups from AlertingService instance, after it was set up with cliend id and secret.

    See more

    Declaration

    Swift

    public final class PerilGroup: NSObject
  • Geographical position described by latitude and longitude coordinates.

    See more

    Declaration

    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:

    1. Instantiate new AlertingService object
    2. Call setup(clientId: clientSecret: launchOptions:) in your AppDelegate's application(_ application: didFinishLaunchingWithOptions:)
    3. Create an asset with create(_ asset) call
    4. Retrieve available peril groups with getAllGroups() call
    5. Prepare an AssetNotification object with one of two types (email or sms) and address (email address or phone number)
    6. Prepare an AssetRegistration object with your asset’s id, selected peril groups and prepared AssetNotification object
    7. Register an asset for selected groups with registerAsset(_ registration) call and pass prepared AssetRegistrationObject into it
    8. Call followMe() to start tracking user location automatically, or retrive the your last Asset object from getCurrentAsset() call, update its location and call update(_ asset) to update its location manually.

    Note

    Do not foget to stop tracking user location by calling setStaticMode() when it is no longer needed.
    See more

    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[log].

    See more

    Declaration

    Swift

    public final class AssetLog: NSObject, Decodable
  • Natural event that Peril groups can contain. If users are registered to a Peril 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 more

    Declaration

    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 Asset object to receive notifications of upcoming weather events nearby it.

    See more

    Declaration

    Swift

    public final class Asset: NSObject
  • Information about asset’s subscription. Includes notifications delivery address and peril groups subscribed to.

    See more

    Declaration

    Swift

    public final class AssetRegistration: NSObject