{"id":20740208,"url":"https://github.com/charmy/react-native-admost","last_synced_at":"2025-04-24T02:25:11.659Z","repository":{"id":143825234,"uuid":"305420822","full_name":"charmy/react-native-admost","owner":"charmy","description":"Admost SDK for React Native","archived":false,"fork":false,"pushed_at":"2024-05-19T15:00:15.000Z","size":2506,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-21T14:21:46.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charmy.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":"2020-10-19T14:58:13.000Z","updated_at":"2024-12-14T16:17:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"905468c6-9015-48f9-86f3-5b3e6ed4767a","html_url":"https://github.com/charmy/react-native-admost","commit_stats":null,"previous_names":["up-inside/react-native-admost"],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmy%2Freact-native-admost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmy%2Freact-native-admost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmy%2Freact-native-admost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmy%2Freact-native-admost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charmy","download_url":"https://codeload.github.com/charmy/react-native-admost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546917,"owners_count":21448414,"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":[],"created_at":"2024-11-17T06:27:46.876Z","updated_at":"2025-04-24T02:25:11.645Z","avatar_url":"https://github.com/charmy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-admost\n\n## Getting started\n\n```shell script\n$ yarn add @charmy.tech/react-native-admost\n```\n\n### Run Example Project\n```shell\nyarn install\ncd example\nyarn run prebuild\nyarn run android -d\nyarn run ios -d\n```\n\n### Android\n- You should follow the \"Edit Files\" section on [AdMost](https://admost.github.io/amrandroid/#edit-files)\n- These dependencies already exist in gradle\n```\n  implementation 'com.admost.sdk:amr:+' \n  implementation 'com.google.android.gms:play-services-base:17.1.0' \n```\n\n#### Update Project `build.grandle`\n```\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        maven { url 'https://mvn-repo.admost.com/artifactory/amr-2' }\n    }\n}\n```\n\n\n### IOS\n- You should follow the \"Create your podfile and install\" section on [AdMost](https://admost.github.io/amrios/#create-your-podfile-and-install)\n- These dependencies already exist in pod\n```\n  s.dependency \"AMRSDK\", \"~\u003e 1.5\"\n```\n\n## Usage\n\n### AdMostAdView\n\n```typescript jsx\nimport React, { useEffect } from \"react\";\nimport { View, StatusBar, SafeAreaView } from \"react-native\";\n\nimport AdMost, { AdMostAdView } from \"@charmy.tech/react-native-admost\";\n\nexport default function App() {\n  useEffect(() =\u003e {\n    const appId = \"\u003cyour-app-id\u003e\";\n\n    AdMost.initAdMost({\n      appId: appId,\n      userConsent: true,\n      subjectToGDPR: false,\n      subjectToCCPA: false,\n      userChild: false,\n    });\n\n    AdMost.setUserId(\"123123\");\n    AdMost.setCanRequestAds(false);\n  }, []);\n\n  return (\n    \u003cSafeAreaView style={{ flex: 1 }}\u003e\n      \u003cView style={{ flex: 1, justifyContent: \"center\" }}\u003e\n        \u003cStatusBar barStyle=\"dark-content\" backgroundColor=\"#ffffff\" /\u003e\n        \u003cAdMostAdView\n          zoneId=\"c4a15983-d6fe-49ec-8e8b-844663190559\"\n          tag=\"Ragib\"\n          style={{ width: \"100%\", height: 50 }}\n          onReady={({ nativeEvent }) =\u003e {\n            console.log(\"ON_READY\", nativeEvent);\n          }}\n          onFail={({ nativeEvent }) =\u003e {\n            console.log(\"ON_FAIL\", nativeEvent);\n          }}\n          onClick={({ nativeEvent }) =\u003e {\n            console.log(\"ON_CLICK\", nativeEvent);\n          }}\n        /\u003e\n\n        \u003cAdMostAdView\n          zoneId=\"\u003cadmost-zone-id\u003e\"\n          style={{ width: \"100%\", height: 250 }}\n          onReady={({ nativeEvent }) =\u003e {\n            console.log(\"ON_READY\", nativeEvent);\n          }}\n          onFail={({ nativeEvent }) =\u003e {\n            console.log(\"ON_FAIL\", nativeEvent);\n          }}\n          onClick={({ nativeEvent }) =\u003e {\n            console.log(\"ON_CLICK\", nativeEvent);\n          }}\n        /\u003e\n      \u003c/View\u003e\n    \u003c/SafeAreaView\u003e\n  );\n}\n\n```\n\n#### Android Custom Layout\n- Create android layout from android studio\n- [It should be like this](./assets/android-custom-layout.png)\n- Set layoutName prop to view\n\n#### IOS Custom Layout\n- `cp -r CustomXibs ${project_rootdir}/node_modules/@charmy.tech/react-native-admost/`\n- `pod install in ios folder`\n- [It should be like this](./assets/ios-custom-layout.png)\n- Set layoutName prop to view\n\n#### Props\n| Prop            | Required | Type      | Default value | Description                                                                                        |\n|-----------------|----------|-----------|---------------|----------------------------------------------------------------------------------------------------|\n| zoneId          | true     | string    |               | AdMost zoneId                                                                                      |\n| layoutName      | false    | string    | DEFAULT       | Custom layout name(layout_admost_native_250, CustomNative200x200)                                  |                                                             |\n| tag             | false    | string    |               | Tags will let you monitor the performance of the ads across different dimensions for the same zone |                                                             |\n| style           | true     | ViewStyle |               | View style ({ width: \"100%\", height: 50 })                                                         | \n| autoLoadDelayMs | false    | number    | 100           | Auto load delay (min 100 ms)                                                                       | \n| onReady         | false    | func      |               | on ready callback event                                                                            | \n| onFail          | false    | func      |               | on fail callback event                                                                             | \n| onClick         | false    | func      |               | on click callback event                                                                            |\n\n### AdMostInterstitial\n```typescript jsx\nimport React, { useEffect } from \"react\";\nimport { View, StatusBar, Button, SafeAreaView } from \"react-native\";\n\nimport AdMost, { AdMostInterstitial } from \"@charmy.tech/react-native-admost\";\n\nexport default function App() {\n  useEffect(() =\u003e {\n    const appId = \"\u003cyour-app-id\u003e\";\n\n    AdMost.initAdMost({\n      appId: appId,\n      userConsent: true,\n      subjectToGDPR: false,\n      subjectToCCPA: false,\n      userChild: false,\n    });\n  }, []);\n\n  // Interstitial events\n  useEffect(() =\u003e {\n    const adMostOnReadyEvent = AdMost.addInterstitialListener.onReady((e) =\u003e {\n      console.log(\"ON_READY\", e);\n      AdMostInterstitial.showAd(e.zoneId, \"TEST\");\n    });\n\n    const adMostOnFailEvent = AdMost.addInterstitialListener.onFail((e) =\u003e {\n      console.log(\"ON_FAIL\", e);\n    });\n\n    const adMostOnDismissEvent = AdMost.addInterstitialListener.onDismiss((e) =\u003e {\n      console.log(\"ON_DISMISS\", e);\n    });\n\n    const adMostOnShownEvent = AdMost.addInterstitialListener.onShown((e) =\u003e {\n      console.log(\"ON_SHOWN\", e);\n    });\n\n    const adMostOnClickedEvent = AdMost.addInterstitialListener.onClicked((e) =\u003e {\n      console.log(\"ON_CLICKED\", e);\n    });\n\n    const adMostOnStatusChangedEvent = AdMost.addInterstitialListener.onStatusChanged((e) =\u003e {\n      console.log(\"ON_STATUS_CHANGED\", e);\n    });\n\n    return () =\u003e {\n      adMostOnReadyEvent.remove();\n      adMostOnFailEvent.remove();\n      adMostOnDismissEvent.remove();\n      adMostOnShownEvent.remove();\n      adMostOnClickedEvent.remove();\n      adMostOnStatusChangedEvent.remove();\n    };\n  });\n\n  return (\n    \u003cSafeAreaView style={{ flex: 1 }}\u003e\n      \u003cView style={{ flex: 1, justifyContent: \"center\" }}\u003e\n        \u003cStatusBar barStyle=\"dark-content\" backgroundColor=\"#ffffff\" /\u003e\n        \u003cButton\n          onPress={() =\u003e AdMostInterstitial.loadAd(\"\u003cadmost-zone-id\u003e\")}\n          title=\"Load Interstitial Ad\"\n          color=\"red\"\n        /\u003e\n      \u003c/View\u003e\n    \u003c/SafeAreaView\u003e\n  );\n}\n```\n\n\n#### Methods\n| Name             | Params                         | Return           | Description           |\n|------------------|--------------------------------|------------------|-----------------------|\n| loadAd           | (zoneId: string)               | void             | Load ad               |\n| destroyAd        | (zoneId: string)               | void             | Destroy Ad            |\n| showAd           | (zoneId: string, tag: string)  | Promise\u003cboolean\u003e | Show when ad is ready |\n| isLoading        | (zoneId: string)               | Promise\u003cboolean\u003e | Ad is loading         |\n| isLoaded         | (zoneId: string)               | Promise\u003cboolean\u003e | Ad is loaded          |\n\n#### Events\n| Name                 | Params                                                                |\n|----------------------|-----------------------------------------------------------------------|\n| ON_READY             | { network: string; ecpm: number; zoneId: string }                     |\n| ON_FAIL              | { errorCode: number; errorDescription?: string(iOS); zoneId: string } |\n| ON_DISMISS           | { message?: string(Android); zoneId: string }                         |\n| ON_SHOWN             | { network: string; zoneId: string }                                   |\n| ON_CLICKED           | { network: string; zoneId: string }                                   |\n| ON_STATUS_CHANGED    | { network: string; zoneId: string }                                   |\n\n### AdMostRewarded\n```typescript jsx\nimport React, { useEffect } from \"react\";\nimport { View, StatusBar, Button, SafeAreaView } from \"react-native\";\n\nimport AdMost, { AdMostRewarded } from \"@charmy.tech/react-native-admost\";\n\nexport default function App() {\n  useEffect(() =\u003e {\n    const appId = \"\u003cyour-app-id\u003e\";\n\n    AdMost.initAdMost({\n      appId: appId,\n      userConsent: true,\n      subjectToGDPR: false,\n      subjectToCCPA: false,\n      userChild: false,\n    });\n  }, []);\n\n  // Rewarded events\n  useEffect(() =\u003e {\n    const adMostOnReadyEvent = AdMost.addRewardedListener.onReady((e) =\u003e {\n      console.log(\"ON_READY\", e);\n      AdMostRewarded.showAd(e.zoneId, \"TEST\");\n    });\n\n    const adMostOnFailEvent = AdMost.addRewardedListener.onFail((e) =\u003e {\n      console.log(\"ON_FAIL\", e);\n    });\n\n    const adMostOnDismissEvent = AdMost.addRewardedListener.onDismiss((e) =\u003e {\n      console.log(\"ON_DISMISS\", e);\n    });\n\n    const adMostOnCompleteEvent = AdMost.addRewardedListener.onComplete((e) =\u003e {\n      console.log(\"ON_COMPLETE\", e);\n    });\n\n    const adMostOnShownEvent = AdMost.addRewardedListener.onShown((e) =\u003e {\n      console.log(\"ON_SHOWN\", e);\n    });\n\n    const adMostOnClickedEvent = AdMost.addRewardedListener.onClicked((e) =\u003e {\n      console.log(\"ON_CLICKED\", e);\n    });\n\n    const adMostOnStatusChangedEvent = AdMost.addRewardedListener.onStatusChanged((e) =\u003e {\n      console.log(\"ON_STATUS_CHANGED\", e);\n    });\n\n    return () =\u003e {\n      adMostOnReadyEvent.remove();\n      adMostOnFailEvent.remove();\n      adMostOnDismissEvent.remove();\n      adMostOnCompleteEvent.remove();\n      adMostOnShownEvent.remove();\n      adMostOnClickedEvent.remove();\n      adMostOnStatusChangedEvent.remove();\n    };\n  });\n\n  return (\n    \u003cSafeAreaView style={{ flex: 1 }}\u003e\n      \u003cView style={{ flex: 1, justifyContent: \"center\" }}\u003e\n        \u003cStatusBar barStyle=\"dark-content\" backgroundColor=\"#ffffff\" /\u003e\n        \u003cButton\n          onPress={() =\u003e AdMostRewarded.loadAd(\"\u003cadmost-zone-id\u003e\")}\n          title=\"Load Rewarded Ad\"\n          color=\"red\"\n        /\u003e\n      \u003c/View\u003e\n    \u003c/SafeAreaView\u003e\n  );\n}\n```\n\n#### Methods\n| Name             | Params                         | Return           | Description           |\n|------------------|--------------------------------|------------------|-----------------------|\n| loadAd           | (zoneId: string)               | void             | Load ad               |\n| destroyAd        | (zoneId: string)               | void             | Destroy Ad            |\n| showAd           | (zoneId: string, tag: string)  | Promise\u003cboolean\u003e | Show when ad is ready |\n| isLoading        | (zoneId: string)               | Promise\u003cboolean\u003e | Ad is loading         |\n| isLoaded         | (zoneId: string)               | Promise\u003cboolean\u003e | Ad is loaded          |\n\n#### Events\n| Name                 | Params                                                                |\n|----------------------|-----------------------------------------------------------------------|\n| ON_READY             | { network: string; ecpm: number; zoneId: string }                     |\n| ON_FAIL              | { errorCode: number; errorDescription?: string(iOS); zoneId: string } |\n| ON_DISMISS           | { message?: string(Android); zoneId: string }                         |\n| ON_COMPLETE          | { network: string; zoneId: string }                                   |\n| ON_SHOWN             | { network: string; zoneId: string }                                   |\n| ON_CLICKED           | { network: string; zoneId: string }                                   |\n| ON_STATUS_CHANGED    | { network: string; zoneId: string }                                   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmy%2Freact-native-admost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharmy%2Freact-native-admost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmy%2Freact-native-admost/lists"}