{"id":21373938,"url":"https://github.com/itenfay/dyfdeviceutils","last_synced_at":"2025-03-16T09:14:12.095Z","repository":{"id":113235155,"uuid":"186655255","full_name":"itenfay/DYFDeviceUtils","owner":"itenfay","description":"A small utility tool for getting the basic information about iOS device.","archived":false,"fork":false,"pushed_at":"2023-06-27T08:27:39.000Z","size":143,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T21:16:47.461Z","etag":null,"topics":["basic","deviceid","idfa","idfv","information","ios","objective-c","utility","utility-classes","uuid"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itenfay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-14T15:57:24.000Z","updated_at":"2023-06-27T08:27:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"6923b9ad-f777-446c-87ec-6909d84e1b89","html_url":"https://github.com/itenfay/DYFDeviceUtils","commit_stats":null,"previous_names":["itenfay/dyfdeviceutils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFDeviceUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFDeviceUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFDeviceUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFDeviceUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itenfay","download_url":"https://codeload.github.com/itenfay/DYFDeviceUtils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847060,"owners_count":20357317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","deviceid","idfa","idfv","information","ios","objective-c","utility","utility-classes","uuid"],"created_at":"2024-11-22T08:29:36.214Z","updated_at":"2025-03-16T09:14:12.029Z","avatar_url":"https://github.com/itenfay.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[If this project can help you, please give it a star. Thanks!](https://github.com/chenxing640/DYFDeviceUtils)\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE)\u0026nbsp;\n\n## DYFDeviceUtils\n\nA small utility tool for getting the basic information about iOS device.\n\n## Group (ID:614799921)\n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/chenxing640/DYFDeviceUtils/raw/master/images/g614799921.jpg\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Usage\n\n1. Depends on SFHFKeychainUtils.\n\n```\npod 'SFHFKeychainUtils', '~\u003e 1.0.0'\n```\n\n2. If you join up advertising tracking, set DYF_IDFA_ALLOWED to 1.\n\n```\n// Allows idfa. Default 0.\n#ifndef DYF_IDFA_ALLOWED\n    #define DYF_IDFA_ALLOWED            0\n#endif\n```\n\n3. If you delete the item of keychain for device identifier, set DYF_DELETE_KEYC_ITEM to 1.\n\n```\n// Deletes the item of keychain for device identifier. Default 0.\n#ifndef DYF_DELETE_KEYC_ITEM\n    #define DYF_DELETE_KEYC_ITEM        0\n#endif\n```\n\n4. Get and print the basic information.\n\n```\n// Gets device identifier.\nNSString *deviceID = DYFDeviceUtils.getUUID;\nNSLog(@\"device identifier: %@\", deviceID);\n\n// Gets device name.\nNSString *deviceName = DYFDeviceUtils.getDeviceName;\nNSLog(@\"device name: %@\", deviceName);\n\n// Whether enable advertising tracking or not.\nBOOL adTrackingEnabled = DYFDeviceUtils.isAdvertisingTrackingEnabled;\nNSLog(@\"ad tracking enabled: %d\", adTrackingEnabled);\n\n// Gets idfa.\nNSString *idfa = DYFDeviceUtils.getAdvertisingIdentifier;\nNSLog(@\"idfa: %@\", idfa);\n\n// Gets idfv.\nNSString *idfv = DYFDeviceUtils.getVendorIdentifier;\nNSLog(@\"idfv: %@\", idfv);\n\n// Gets system hardware model.\nNSString *hwModel = DYFDeviceUtils.getModel;\nNSLog(@\"hardware model: %@\", hwModel);\n\n// Gets system hardware machine identifier.\nNSString *hwMachine = DYFDeviceUtils.getMachine;\nNSLog(@\"hardware machine: %@\", hwMachine);\n\n// Gets country code.\nNSString *countryCode = DYFDeviceUtils.getCountryCode;\nNSLog(@\"country code: %@\", countryCode);\n\n// Gets preferred language.\nNSString *preferredLanguage = DYFDeviceUtils.getPreferredLanguage;\nNSLog(@\"preferred language: %@\", preferredLanguage);\n\n// Gets system version.\nNSString *sysVersion = DYFDeviceUtils.getSystemVersion;\nNSLog(@\"system version: %@\", sysVersion);\n\n// Gets user interface idiom.\nUIUserInterfaceIdiom uiIfIdiom = DYFDeviceUtils.getUserInterfaceIdiom;\nNSLog(@\"user interface idiom: %zi\", uiIfIdiom);\n\n// Gets battery state.\n// UIDeviceBatteryStateUnknown,\n// UIDeviceBatteryStateUnplugged,   // on battery, discharging\n// UIDeviceBatteryStateCharging,    // plugged in, less than 100%\n// UIDeviceBatteryStateFull,        // plugged in, at 100%\nUIDeviceBatteryState batteryState = DYFDeviceUtils.getBatteryState;\nNSLog(@\"battery state.: %zi\", batteryState);\n\n// Gets battery level.\nCGFloat batteryLevel = DYFDeviceUtils.getBatteryLevel;\nNSLog(@\"battery level: %.2f\", batteryLevel);\n\n// Whether support multitasking or not.\nBOOL multitaskingSupported = DYFDeviceUtils.isMultitaskingSupported;\nNSLog(@\"multitasking supported: %d\", multitaskingSupported);\n```\n\n## Logs\n\n```\nDYFDeviceUtils[3706:666709] device identifier: DB5D6298-73C9-459E-B279-93CF0E97866C\nDYFDeviceUtils[3706:666709] device name: Hanson lee\nDYFDeviceUtils[3706:666709] ad tracking enabled: 0\nDYFDeviceUtils[3706:666709] idfa: CF0E9786-9EA6-1A8C-D342-C90E26C889A0\nDYFDeviceUtils[3706:666709] idfv: DB5D6298-73C9-459E-B279-93CF0E97866C\nDYFDeviceUtils[3706:666709] hardware model: D21AP\nDYFDeviceUtils[3706:666709] hardware machine: iPhone10,2\nDYFDeviceUtils[3706:666709] country code: CN\nDYFDeviceUtils[3706:666709] preferred language: zh-Hans\nDYFDeviceUtils[3706:666709] system version: 12.3.1\nDYFDeviceUtils[3706:666709] user interface idiom: 0\nDYFDeviceUtils[3706:666709] battery state.: 0\nDYFDeviceUtils[3706:666709] battery level: -1.00\nDYFDeviceUtils[3706:666709] multitasking supported: 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fdyfdeviceutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitenfay%2Fdyfdeviceutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fdyfdeviceutils/lists"}