{"id":15491115,"url":"https://github.com/myconsciousness/admob-unit-ids","last_synced_at":"2025-07-14T19:34:49.494Z","repository":{"id":56825826,"uuid":"393068140","full_name":"myConsciousness/admob-unit-ids","owner":"myConsciousness","description":"Admob Unit IDs is a library that provides a common structure for managing AdMob unit IDs licensed under BSD 3-Clause.","archived":false,"fork":false,"pushed_at":"2021-12-28T04:44:27.000Z","size":30,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-03T07:43:52.096Z","etag":null,"topics":["admob","dart","flutter","id","library","package","pubdev","unit","unit-id"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/admob_unit_ids","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myConsciousness.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2021-08-05T14:15:24.000Z","updated_at":"2024-04-08T09:30:56.000Z","dependencies_parsed_at":"2022-08-27T03:08:37.877Z","dependency_job_id":null,"html_url":"https://github.com/myConsciousness/admob-unit-ids","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fadmob-unit-ids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fadmob-unit-ids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fadmob-unit-ids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fadmob-unit-ids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myConsciousness","download_url":"https://codeload.github.com/myConsciousness/admob-unit-ids/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220476167,"owners_count":16653748,"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":["admob","dart","flutter","id","library","package","pubdev","unit","unit-id"],"created_at":"2024-10-02T07:43:47.117Z","updated_at":"2024-10-19T06:42:13.288Z","avatar_url":"https://github.com/myConsciousness.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Dart](https://github.com/myConsciousness/admob-unit-ids/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/myConsciousness/admob-unit-ids/actions/workflows/dart.yml)\n\n# 1. Admob Unit IDs\n\n## 1.1. What is it?\n\n`Admob Unit IDs` is a library that provides a common structure for managing AdMob unit IDs licensed under BSD 3-Clause.\n\n\u003c!-- TOC --\u003e\n\n- [1. Admob Unit IDs](#1-admob-unit-ids)\n  - [1.1. What is it?](#11-what-is-it)\n  - [1.2. Motivation](#12-motivation)\n  - [1.3. How To Use](#13-how-to-use)\n    - [1.3.1. Get library](#131-get-library)\n    - [1.3.2. Import and extend abstract class](#132-import-and-extend-abstract-class)\n    - [1.3.3. Override methods](#133-override-methods)\n    - [1.3.4. Call methods to get AdMob Unit IDs](#134-call-methods-to-get-admob-unit-ids)\n    - [1.3.5. Overview](#135-overview)\n  - [1.4. More Information](#14-more-information)\n\n\u003c!-- /TOC --\u003e\n\n## 1.2. Motivation\n\n1. Provide common functionality regarding unit IDs when implementing AdMob.\n2. Reduce redundant settings when deploying AdMob.\n\n## 1.3. How To Use\n\n### 1.3.1. Get library\n\nRun this command:\n\nWith Flutter:\n\n```terminal\nflutter pub add admob_unit_ids\n```\n\n### 1.3.2. Import and extend abstract class\n\n```dart\nimport 'package:admob_unit_ids/admob_unit_ids.dart';\n\nclass DemoAdmobUnitIDs extends AdmobUnitIDs {\n}\n```\n\n### 1.3.3. Override methods\n\n| Method Name                 | Remarks                                                       |\n| --------------------------- | ------------------------------------------------------------- |\n| releaseAppOpen              | Should return unit id of app open for releasing.              |\n| releaseBanner               | Should return unit id of banner for releasing.                |\n| releaseInterstitial         | Should return unit id of interstitial for releasing.          |\n| releaseInterstitialVideo    | Should return unit id of interstitial video for releasing.    |\n| releaseNativeAdvanced       | Should return unit id of native advanced for releasing.       |\n| releaseNativeAdvancedVideo  | Should return unit id of native advanced video for releasing. |\n| releaseRewarded             | Should return unit id of rewarded for releasing.              |\n| releaseRewardedInterstitial | Should return unit id of rewarded interstitial for releasing. |\n\n```dart\nimport 'package:universal_io/io.dart';\nimport 'package:admob_unit_ids/admob_unit_ids.dart';\n\nclass DemoAdmobUnitIDs extends AdmobUnitIDs {\n  @override\n  String get releaseAppOpen =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseBanner =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseInterstitial =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseInterstitialVideo =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseNativeAdvanced =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseNativeAdvancedVideo =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseRewarded =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseRewardedInterstitial =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n}\n```\n\n### 1.3.4. Call methods to get AdMob Unit IDs\n\nIf you override the above abstract methods in a class that extends from this abstract class, basically no need to use the overridden methods directly. But you can use the methods defined in this abstract class to get the unit ID depends on the application startup status.\n\nThe following methods check the application startup status, and returns the unit ID for testing when debugging, and returns the release unit ID implemented in concrete class extended this abstract class when releasing.\n\n| Method Name          | Remarks                                                                  |\n| -------------------- | ------------------------------------------------------------------------ |\n| appOpen              | Returns the unit id of app open for debugging or releasing.              |\n| banner               | Returns the unit id of banner for debugging or releasing.                |\n| interstitial         | Returns the unit id of interstitial for debugging or releasing.          |\n| interstitialVideo    | Returns the unit id of interstitial video for debugging or releasing.    |\n| nativeAdvanced       | Returns the unit id of native advanced for debugging or releasing.       |\n| nativeAdvancedVideo  | Returns the unit id of native advanced video for debugging or releasing. |\n| rewarded             | Returns the unit id of rewarded for debugging or releasing.              |\n| rewardedInterstitial | Returns the unit id of rewarded interstitial for debugging or releasing. |\n\n```dart\nvoid main() {\n  final AdmobUnitIDs admobUnitIDs = DemoAdmobUnitIDs();\n\n  // =\u003e Unit id for debugging or unit id for releasing.\n  print(admobUnitIDs.appOpen);\n  print(admobUnitIDs.banner);\n  print(admobUnitIDs.interstitial);\n  print(admobUnitIDs.interstitialVideo);\n  print(admobUnitIDs.nativeAdvanced);\n  print(admobUnitIDs.nativeAdvancedVideo);\n  print(admobUnitIDs.rewarded);\n  print(admobUnitIDs.rewardedInterstitial);\n}\n```\n\n### 1.3.5. Overview\n\n```dart\nimport 'package:universal_io/io.dart';\nimport 'package:admob_unit_ids/admob_unit_ids.dart';\n\nclass DemoAdmobUnitIDs extends AdmobUnitIDs {\n  /// The singleton instance of [DemoAdmobUnitIDs].\n  static final DemoAdmobUnitIDs _singletonInstance = DemoAdmobUnitIDs._internal();\n\n  /// The internal default constructor.\n  DemoAdmobUnitIDs._internal();\n\n  /// Returns the singleton instance of [DemoAdmobUnitIDs].\n  factory DemoAdmobUnitIDs.getInstance() =\u003e _singletonInstance;\n\n  @override\n  String get releaseAppOpen =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseBanner =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseInterstitial =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseInterstitialVideo =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseNativeAdvanced =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseNativeAdvancedVideo =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseRewarded =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n\n  @override\n  String get releaseRewardedInterstitial =\u003e Platform.isAndroid\n      ? 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx'\n      : 'ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx';\n}\n\nvoid main() {\n  final AdmobUnitIDs admobUnitIDs = DemoAdmobUnitIDs.getInstance();\n\n  // =\u003e Unit id for debugging or unit id for releasing.\n  print(admobUnitIDs.appOpen);\n  print(admobUnitIDs.banner);\n  print(admobUnitIDs.interstitial);\n  print(admobUnitIDs.interstitialVideo);\n  print(admobUnitIDs.nativeAdvanced);\n  print(admobUnitIDs.nativeAdvancedVideo);\n  print(admobUnitIDs.rewarded);\n  print(admobUnitIDs.rewardedInterstitial);\n}\n```\n\n## 1.4. More Information\n\n`AdmobUnitIDs` was designed and implemented by **_Kato Shinya_**.\n\n- [Creator Profile](https://github.com/myConsciousness)\n- [License](https://github.com/myConsciousness/admob-unit-ids/blob/main/LICENSE)\n- [Release Note](https://github.com/myConsciousness/admob-unit-ids/releases)\n- [File a Bug](https://github.com/myConsciousness/admob-unit-ids/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fadmob-unit-ids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyconsciousness%2Fadmob-unit-ids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fadmob-unit-ids/lists"}