class AppStoreConnect::Client::Usage

Constants

MIXPANEL_PROJECT_TOKEN
OPTIONS

Public Class Methods

new(options = {}) click to toggle source
# File lib/app_store_connect/client/usage.rb, line 15
def initialize(options = {})
  @enabled = options[:analytics_enabled].to_s == 'true'
  @distinct_id = SecureRandom.uuid
  @tracker = Mixpanel::Tracker.new(MIXPANEL_PROJECT_TOKEN)
end

Public Instance Methods

track() click to toggle source
# File lib/app_store_connect/client/usage.rb, line 21
def track
  return false unless @enabled

  @tracker.track(@distinct_id, 'usage', version: VERSION)
end