{"id":36696579,"url":"https://github.com/uiwjs/react-native-transport-location","last_synced_at":"2026-01-12T11:32:33.718Z","repository":{"id":43334160,"uuid":"303630585","full_name":"uiwjs/react-native-transport-location","owner":"uiwjs","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-15T13:51:28.000Z","size":7062,"stargazers_count":6,"open_issues_count":15,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T14:44:50.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uiwjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-13T08:00:47.000Z","updated_at":"2023-11-22T07:22:57.000Z","dependencies_parsed_at":"2022-09-09T05:32:16.437Z","dependency_job_id":"548d319a-024a-4b3a-906a-c3e8055a943a","html_url":"https://github.com/uiwjs/react-native-transport-location","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/uiwjs/react-native-transport-location","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-native-transport-location","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-native-transport-location/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-native-transport-location/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-native-transport-location/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uiwjs","download_url":"https://codeload.github.com/uiwjs/react-native-transport-location/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-native-transport-location/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-12T11:32:33.018Z","updated_at":"2026-01-12T11:32:33.710Z","avatar_url":"https://github.com/uiwjs.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"@uiw/react-native-transport-location\n---\n\n部网络货运信息交互系统位置信息上报\n\n## 注意事项\n\n\u003cdetails\u003e\n\u003csummary\u003e设置允许 HTTP 请求访问\u003c/summary\u003e\n\n#### Android\n\n创建配置文件 `android/app/src/main/res/xml/network_security_config.xml` 内容如下：\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cnetwork-security-config\u003e\n    \u003cbase-config cleartextTrafficPermitted=\"true\" /\u003e\n\u003c/network-security-config\u003e\n```\n\n修改配置 `android/app/src/main/AndroidManifest.xml`\n\n```diff\n\u003capplication\n  android:name=\".MainApplication\"\n  android:label=\"@string/app_name\"\n  android:icon=\"@mipmap/ic_launcher\"\n  android:roundIcon=\"@mipmap/ic_launcher_round\"\n  android:allowBackup=\"false\"\n+  android:networkSecurityConfig=\"@xml/network_security_config\"\n  android:theme=\"@style/AppTheme\"\u003e\n\u003c/application\u003e\n```\n\n#### iOS\n\n修改 `ios/\u003c应用名称\u003e/Info.plist` 配置\n\n```xml\n\u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n\u003cdict\u003e\n  \u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n  \u003ctrue/\u003e\n\u003c/dict\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAndroid 配置高德地图 key\u003c/summary\u003e\n\n`example/android/app/src/main/AndroidManifest.xml`\n\n```xml\n\u003cmeta-data android:name=\"com.amap.api.v2.apikey\" android:value=\"{你的高德key}\" /\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e iOS: ⚠️ GMObjC 只支持 ARM64 的架构\u003c/summary\u003e\n\nGMObjC 里面用到的 `OpenSSL` 配置 `armv7` 有问题，`GMObjC.framework` 动态包也是只支持 ARM64\n\n![](https://user-images.githubusercontent.com/1680273/96695165-ea8f3d00-13bb-11eb-84bf-a647c69d12c9.jpg)\n\n设置 `Xcode` -\u003e `Targets` -\u003e `项目名称` -\u003e `Build Settings` -\u003e `Architectures` 值为 `arm64`\n\n- 2019 A13芯片arm64e：iphone11、iphone11 Pro\n- 2018 A12芯片arm64e：iphone XS、iphone XS Max、iphoneXR\n- 2017 A11芯片arm64：iPhone 8、iPhone 8 Plus、and iPhone X\n- 2016 A10芯片arm64：iPhone 7、7 Plus、iPad (2018)\n- 2015 A9芯片arm64：iPhone 6S、6S Plus\n- 2014 A8芯片arm64：iPhone 6、iPhone 6 Plus\n- 2013 A7芯片arm64：iPhone 5S\n- armv7s：iPhone5、iPhone5C、iPad4(iPad with Retina Display)\n- armv7：iPhone4、iPhone4S、iPad、iPad2、iPad3(The New iPad)、iPad mini、iPod Touch\n\n```bash\nlipo -info GMObjC.framework/GMObjC\n# Non-fat file: GMObjC.framework/GMObjC is architecture: arm64\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e iOS: 端需要开启始终定位\u003c/summary\u003e\n\n`example/ios/\u003c项目名称\u003e/Info.plist`\n\niOS 11 版本：\n\n`NSLocationAlwaysAndWhenInUseUsageDescription` 申请Always权限，以便应用在前台和后台（suspend 或 terminated）都可以获取到更新的位置数据（`NSLocationWhenInUseUsageDescription` 也必须有）。\n\n⚠️ 注意：如果需要同时支持在iOS8-iOS10和iOS11系统上后台定位，建议在plist文件中同时添加 `NSLocationWhenInUseUsageDescription`、`NSLocationAlwaysUsageDescription`和`NSLocationAlwaysAndWhenInUseUsageDescription`权限申请。\n\n```xml\n\u003ckey\u003eNSLocationWhenInUseUsageDescription\u003c/key\u003e\n\u003cstring\u003e使用期间定位，以便获取位置信息\u003c/string\u003e\n\u003ckey\u003eNSLocationAlwaysUsageDescription\u003c/key\u003e\n\u003cstring\u003e持续定位，以便获取行驶路线\u003c/string\u003e\n\u003ckey\u003eNSLocationAlwaysAndWhenInUseUsageDescription\u003c/key\u003e\n\u003cstring\u003e持续定位，以便获取行驶路线\u003c/string\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e iOS: bitcode bundle could not be generated because，编译报错不支持 bitcode\u003c/summary\u003e\n\n### 不支持 bitcode，什么是bitcode\n\nbitcode 简单说就是编程语言与计算机可以直接执行的机器语言之间的中间码。苹果为了减少包的大小，打包时会将项目编译成 bitcode，上传给 App Store，用户下载时，bitcode 可以根据机型版本，生成不同的包去适配。大概就是这么个意思，具体内容[请戳这里](http://io.diveinedu.com/2016/01/16/%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3iOS%E5%BC%80%E5%8F%91%E4%B8%AD%E7%9A%84BitCode%E5%8A%9F%E8%83%BD.html)。\n\n### 解决方案\n\nXcode7 开始，新建项目默认就打开了 `bitcode` 设置。而且大部分开发者都被这个突如其来的 `bitcode` 功能给坑过导致项目编译失败，这些因为 `bitcode` 而编译失败的的项目都有一个共同点，就是链接了第三方库或者框架，而这些框架或者库不支持 `bitcode` ，从而导致项目编译不成功。\n解决方案有两种(目前只有第二种解决方案)：\n\n1. 联系第三方框架 [`MapManager.framework`](ios/MapManager.framework) 的提供者，让他们支持 `bitcode`，这个执行起来有难度。\n2. 关闭 `bitcode` 功能；在 xcode 里把 `TARGETS` -\u003e `Build Setting` -\u003e `Build Options` -\u003e `Enable Bitcode` 设置为 `NO`;\n\n### 报错信息\n\n```bash\nld: bitcode bundle could not be generated because '******/react-native-transport-location/ios/MapManager.framework/MapManager(MapService.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n```\n\n\u003c/details\u003e\n\n\u003e - ⚠️ 高德地图定位部分 API 需要真机调试和 `Access WiFi Information` 权限。\n\u003e - 适用于 `react-native` `\u003e= 0.60+` 低版本未测试。\n\u003e - 支持手机系统：iOS（苹果）、Android（安卓）。\n\u003e - 需要设置允许 HTTP 请求访问\n\u003e - React Native 带的自带的包 [OpenSSL-Universal](https://cocoapods.org/pods/OpenSSL-Universal) 与 [GMObjC](https://cocoapods.org/pods/GMObjC) 自带的 GMOpenSSL 冲突 [已解决 #1](https://github.com/uiwjs/react-native-transport-location/issues/4)\n\n## 安装依赖\n\n```bash\nyarn add @uiw/react-native-transport-location\n# react-native version \u003e= 0.60+\n$ cd ios \u0026\u0026 pod install\n```\n\n## api\n\n- init\n- start\n- end\n\n## 其它\n\n当前工程基于 [@brodybits/create-react-native-module](https://github.com/brodybits/create-react-native-module) 初始化。\n\n```bash\nnpx create-react-native-module --package-identifier com.uiwjs.react.transport.location --object-class-name RNTransportLocation --generate-example TransportLocation --example-react-native-version 0.63.3 --module-name @uiw/react-native-transport-location --github-account uiwjs --author-name \"Kenny Wong\" --author-email \"wowohoo@qq.com\"\n```\n\n## 开发\n\n```bash\ncd example   # 进入实例 example 工程，根目录不需要安装，会引发错误\nyarn install # 安装依赖\n\ncd ios     # 进入 example/ios 目录安装依赖\npod install # 安装依赖\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiwjs%2Freact-native-transport-location","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiwjs%2Freact-native-transport-location","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiwjs%2Freact-native-transport-location/lists"}