Ping

public class Ping<ReasonCodesEnum> : PingBase where ReasonCodesEnum : ReasonCodes

This implements the developer facing API for custom pings.

Instances of this class type are automatically generated by the parsers at build time.

The Ping API only exposes the Ping.sumbit() method, which collects and schedules a ping for eventual upload.

  • The public constructor used by automatically generated metrics.

    Declaration

    Swift

    public init(name: String, includeClientId: Bool, sendIfEmpty: Bool, reasonCodes: [String])
  • Collect and submit the ping for eventual uploading.

    While the collection of metrics into pings happens synchronously, the ping queuing and ping uploading happens asyncronously. There are no guarantees that this will happen immediately.

    If the ping currently contains no content, it will not be queued.

    Declaration

    Swift

    public func submit(reason: ReasonCodesEnum? = nil)

    Parameters

    reason

    The reason the ping is being submitted.

  • Collect and submit the ping for eventual uploading.

    THIS METHOD IS DEPRECATED. Use submit instead.

    While the collection of metrics into pings happens synchronously, the ping queuing and ping uploading happens asyncronously. There are no guarantees that this will happen immediately.

    If the ping currently contains no content, it will not be queued.

    Declaration

    Swift

    @available(*, deprecated, renamed: "submit")
    public func send()