thinkwelltwd / device_detector

118 stars 44 forks source link

unable to recognize salesforcemobilesdk #25

Closed loganfan closed 5 years ago

loganfan commented 5 years ago

Thanks for this great package. Just found it can't recognize salesforecemobilesdk. please find the 2 example below: SalesforceMobileSDK/7.0.0 android mobile/8.0.0 (VS996) Salesforce1/220.3(220030100) Native uid_48de40dfc42c7f9c ftr_AI.UA Cordova/7.1.2 Hybrid SalesforceMobileSDK/7.0.0 android mobile/8.0.0 (VS996) Salesforce1/220.3(220030100) Native uid_48de40dfc42c7f9c SalesforceMobileSDK/6.1.0 iOS/12.3.1 (iPhone) Chatter/18.3(6137609) Hybrid uid_8468E465-2EC2-4B46-90B5-F83D7F0028FD ftr_GS.PN.UA Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iPhone/12.3.1 Thanks

thinkwelltwd commented 5 years ago

Check the out the ['client']['secondary_client'] key

>>> ua = 'SalesforceMobileSDK/7.0.0 android mobile/8.0.0 (VS996) Salesforce1/220.3(220030100) Native uid_48de40dfc42c7f9c ftr_AI.UA Cordova/7.1.2 Hybrid SalesforceMobileSDK/7.0.0 android mobile/8.0.0 
(VS996) Salesforce1/220.3(220030100) Native uid_48de40dfc42c7f9c'
>>> dd = DeviceDetector(ua).parse()
>>> pp.pprint(dd.all_details)
{   'bot': {},
    'client': {   'app_id': '',
                  'engine': {'default': 'WebKit'},
                  'name': 'Android Browser',
                  'secondary_client': {   'name': 'SalesforceMobileSDK',
                                          'type': 'library',
                                          'version': '7.0.0'},
                  'short_name': 'AN',
                  'type': 'browser',
                  'version': ''},
    'device': {   'brand': 'LG',
                  'device': 'smartphone',
                  'model': 'V30',
                  'name': 'LG',
                  'type': 'smartphone'},
    'normalized': '',
    'os': {   'family': 'Android',
              'name': 'Android',
              'platform': '',
              'short_name': 'AND',
              'type': 'os',
              'version': ''}}