Class: PM::MapRelations

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-byte-panglem-beta/config.rb

Overview

adn mediation adapter 三者之间的映射关系, mediation后续会用到

Constant Summary collapse

ADNADAPTER =
Hash[
  ## sdk 不需要
  # 'Ads-CN' => 'ABUAdCsjAdapter',
  'UnityAds' => 'ABUAdUnityAdapter',
  'Google-Mobile-Ads-SDK'=> 'ABUAdAdmobAdapter',
  'BaiduMobAdSDK'=> 'ABUAdBaiduAdapter',
  'GDTMobSDK'=> 'ABUAdGdtAdapter',
  'SigmobAd-iOS'=> 'ABUAdSigmobAdapter',
  'KSAdSDK'=> 'ABUAdKsAdapter',
  'KlevinAdSDK'=> 'ABUAdKlevinAdapter',
  'MintegralAdSDK'=> 'ABUAdMintegralAdapter',
].freeze
SERVERMAPADAPTER =

sdk 被接入adapter的映射关系

Hash[

  'GoogleMobileAdsMediationPangle'=> 'admob',
  'IronSourcePangleAdapter'=> 'ironsource',
  'AppLovinMediationByteDanceAdapter'=> 'max',
  'TradPlusAdSDK/PangleAdapter'=> 'tradplus',
  'AnyThinkiOS/AnyThinkPangleAdapter'=> 'topon',
].freeze
SERVERMAPADN =
Hash[
  'UnityAds' => 'unity',
  'Google-Mobile-Ads-SDK'=> 'admob',
  'BaiduMobAdSDK'=> 'baidu',
  'GDTMobSDK'=> 'gdt',
  'SigmobAd-iOS'=> 'sigmob',
  'KSAdSDK'=> 'ks',
  'KlevinAdSDK'=> 'klevin',
  'MintegralAdSDK'=> 'mtg',
].freeze
SDKNAME =

SDKNAME = “Ads-Global-Beta”.freeze

PM::BuildConfig.pangle_sdk_release
SDKRELY =
PM::BuildConfig.rely_name
SHOULD_REMOVE =
[SDKRELY, PM::BuildConfig.pangle_sdk_release, PM::BuildConfig.pangle_sdk_beta]

Class Method Summary collapse

Class Method Details

.get_adapter(name) ⇒ Object



133
134
135
136
137
138
139
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 133

def self.get_adapter(name)
  adapter = ''
  if is_adn?(name)
    adapter = ADNADAPTER[name]
  end
  adapter
end

.get_adapter_from_adn_abbreviation(name) ⇒ Object



113
114
115
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 113

def self.get_adapter_from_adn_abbreviation(name)
  SERVERMAPADAPTER[name]
end

.get_adn(name) ⇒ Object



141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 141

def self.get_adn(name)
  adn_name = ''
  if is_adapter?(name)
    ## .index 在调试时候会报错
    ADNADAPTER.select{ |key, value|
    if value == name
      adn_name = key
      break
    end
    true
    }
  end
  adn_name
end

.get_adn_abbreviation(name) ⇒ Object



109
110
111
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 109

def self.get_adn_abbreviation(name)
  SERVERMAPADN[name]
end

.get_all_adapterObject



156
157
158
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 156

def self.get_all_adapter
  ADNADAPTER.values
end

.get_all_adnObject



160
161
162
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 160

def self.get_all_adn
  ADNADAPTER.keys
end

.get_sdkObject



164
165
166
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 164

def self.get_sdk
  SDKNAME
end

.is_adapter?(name) ⇒ Boolean

Returns:

  • (Boolean)


125
126
127
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 125

def self.is_adapter?(name)
  SERVERMAPADAPTER.has_key?(name)
end

.is_adn?(name) ⇒ Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 105

def self.is_adn?(name)
  name == SDKNAME
end

.is_sdk?(name) ⇒ Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 121

def self.is_sdk?(name)
  SDKNAME==name
end

.should_remove_requirements?(name) ⇒ Boolean

Returns:

  • (Boolean)


129
130
131
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 129

def self.should_remove_requirements?(name)
  SHOULD_REMOVE.include?(name)
end