{"id":19175721,"url":"https://github.com/24jieqi/react-native-geyan","last_synced_at":"2025-09-23T10:55:37.342Z","repository":{"id":64534451,"uuid":"564238438","full_name":"24jieqi/react-native-geyan","owner":"24jieqi","description":"个验一键登录 React Native 版本","archived":false,"fork":false,"pushed_at":"2024-12-25T06:49:16.000Z","size":27093,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T20:53:02.299Z","etag":null,"topics":["getui-sdk","native-module","react-native"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/24jieqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-11-10T09:43:05.000Z","updated_at":"2025-02-25T01:03:34.000Z","dependencies_parsed_at":"2025-01-15T19:15:14.080Z","dependency_job_id":"b41fb1ff-f582-43a1-b357-136dd642a05d","html_url":"https://github.com/24jieqi/react-native-geyan","commit_stats":{"total_commits":29,"total_committers":4,"mean_commits":7.25,"dds":0.3448275862068966,"last_synced_commit":"c27dc74a5388d03113206fd31d5685cd8a64777e"},"previous_names":["24jieqi/react-native-geyan","hjfruit/react-native-geyan"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24jieqi%2Freact-native-geyan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24jieqi%2Freact-native-geyan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24jieqi%2Freact-native-geyan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24jieqi%2Freact-native-geyan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/24jieqi","download_url":"https://codeload.github.com/24jieqi/react-native-geyan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111976,"owners_count":21049577,"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":["getui-sdk","native-module","react-native"],"created_at":"2024-11-09T10:24:42.047Z","updated_at":"2025-09-23T10:55:32.278Z","avatar_url":"https://github.com/24jieqi.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-geyan\n\n个推[“个验·一键认证”](https://docs.getui.com/geyan/elogin/)React-Native 原生模块\n\n## Installation\n\n```sh\nyarn add react-native-geyan\n```\n\n## Setup\n\n\u003e 在使用此模块前请先在个推管理后台完成应用创建\n\n### Android\n\n编辑`android/app/build.gradle`，添加`appId`和`channel`\n\n```gradle\nandroid {\n  ...\n  defaultConfig {\n    ...\n    manifestPlaceholders = [\n      GETUI_APPID: \"your app id\",\n      GT_INSTALL_CHANNEL: \"getui\" // your channel\n    ]\n  }\n}\n```\n\n确保`applicationId`与应用后台 Android 包名一致\n确保后台填写的**Android 签名(MD5)**和应用使用的`keystore`文件保持一致\n\n### iOS\n\n确保`Bundle Identifier`和个验后台配置一致\n\n## Usage\n\n```js\nimport { open, init, close, isPreLoginResultValid } from 'react-native-geyan';\nconst logo = require('./assets/logo.png');\n\ninit({\n  appid: 'your appid',\n});\n\nasync function startELogin() {\n  if (!isPreLoginResultValid()) {\n    return;\n  }\n  try {\n    const token = await open({\n      logo,\n    });\n    console.log(token: `${token}`)\n  } catch(e) {\n    // ...\n  }\n  // iOS only\n  await close();\n}\n```\n\n\u003e iOS 需要手动调用`close`关闭一键登录页面\n\n更详细的使用方式见`example`\n\n## API\n\n### `init(config: GeyanInitConfig): Promise\u003cstring\u003e`\n\n```ts\ninterface GeyanInitConfig {\n  /**\n   * 渠道（Android only）\n   */\n  channel?: string;\n  /**\n   * appid（iOS only）\n   */\n  appid: string;\n}\n```\n\n初始化 SDK 并进行预登录\n\n### `open(config: GeyanConfig): Promise\u003cGeyanResult\u003e`\n\n```ts\ninterface GeyanConfig {\n  /**\n   * 应用图标（用于一键登录页logo露出）\n   */\n  logo: ImageSourcePropType;\n  /**\n   * 自定义的隐私策略 (Android only) (若无请传空数组)\n   */\n  privacy?: PrivacyItem[];\n}\n```\n\n打开一键登录页，成功后返回`token`\n\n### `close(): Promise`\n\n关闭一键登录页面\n\n\u003e 仅 iOS 支持\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F24jieqi%2Freact-native-geyan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F24jieqi%2Freact-native-geyan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F24jieqi%2Freact-native-geyan/lists"}