{"id":15063387,"url":"https://github.com/ceamkrier/rn-esptouch","last_synced_at":"2026-01-19T01:33:44.925Z","repository":{"id":65526096,"uuid":"516363294","full_name":"CeamKrier/rn-esptouch","owner":"CeamKrier","description":"React-native wrapper of the ESPTouch","archived":false,"fork":false,"pushed_at":"2022-07-21T13:19:26.000Z","size":70,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T13:06:42.477Z","etag":null,"topics":["esp32","esp8266","esptouch","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CeamKrier.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}},"created_at":"2022-07-21T12:31:28.000Z","updated_at":"2022-11-09T18:54:46.000Z","dependencies_parsed_at":"2023-01-27T09:00:58.544Z","dependency_job_id":null,"html_url":"https://github.com/CeamKrier/rn-esptouch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeamKrier%2Frn-esptouch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeamKrier%2Frn-esptouch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeamKrier%2Frn-esptouch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CeamKrier%2Frn-esptouch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CeamKrier","download_url":"https://codeload.github.com/CeamKrier/rn-esptouch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247297662,"owners_count":20915889,"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":["esp32","esp8266","esptouch","react-native"],"created_at":"2024-09-24T23:55:54.910Z","updated_at":"2026-01-19T01:33:44.915Z","avatar_url":"https://github.com/CeamKrier.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rn-esptouch\n\nThis is a Unofficial project. The official demo is below:\n\n[EsptouchForAndroid](https://github.com/EspressifApp/EsptouchForAndroid)\n\n[EsptouchForIOS](https://github.com/EspressifApp/EsptouchForIOS)\n\n## Getting started\n\n`$ npm install rn-esptouch --save`\n\n### Mostly automatic installation\n\n`$ react-native link rn-esptouch`\n\n### Manual installation\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `rn-esptouch` and add `RNEsptouch.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libRNEsptouch.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\u003c\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n\n-   Add `import com.rickl.rn.esptouch.RNEsptouchPackage;` to the imports at the top of the file\n-   Add `new RNEsptouchPackage()` to the list returned by the `getPackages()` method\n\n2. Append the following lines to `android/settings.gradle`:\n    ```\n    include ':rn-esptouch'\n    project(':rn-esptouch').projectDir = new File(rootProject.projectDir, \t'../node_modules/rn-esptouch/android')\n    ```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n    ```\n      compile project(':rn-esptouch')\n    ```\n\n## Additional react native modules needed for getting location service permission\n\nreact-native-permissions\nreact-native-android-location-service\n\n## Usage\n\n```javascript\nimport React, { Component } from \"react\";\nimport { Platform, StyleSheet, Text, Button, View, DeviceEventEmitter } from \"react-native\";\nimport RNEsptouch from \"rn-esptouch\";\nimport Permissions from \"react-native-permissions\";\nimport RNAndroidLocationService from \"react-native-android-location-service\";\n\nexport default class App extends Component {\n    constructor(props) {\n        super(props);\n        this.onPress = this.onPress.bind(this);\n    }\n    state = {\n        lng: 0.0,\n        lat: 0.0\n    };\n\n    //request permission to access location\n    requestPermission = () =\u003e {\n        Permissions.request(\"location\").then(response =\u003e {\n            //returns once the user has chosen to 'allow' or to 'not allow' access\n            //response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'\n            this.setState({ locationPermission: response });\n        });\n    };\n\n    onLocationChange(e) {\n        this.setState({\n            lng: e.Longitude,\n            lat: e.Latitude\n        });\n    }\n\n    componentDidMount() {\n        this.requestPermission();\n        if (!this.eventEmitter) {\n            // Register Listener Callback - has to be removed later\n            this.eventEmitter = DeviceEventEmitter.addListener(\"updateLocation\", this.onLocationChange.bind(this));\n            // Initialize RNGLocation\n            if (Platform.OS === \"android\") {\n                RNAndroidLocationService.getLocation();\n            }\n        }\n        RNEsptouch.initESPTouch();\n    }\n\n    componentWillUnmount() {\n        // Stop listening for Events\n        this.eventEmitter.remove();\n\n        RNEsptouch.finish();\n    }\n\n    onPress() {\n        let connected_wifi_password = \"12345678\";\n        let broadcast_type = 1; // 1: broadcast;\t0: multicast\n        RNEsptouch.startSmartConfig(connected_wifi_password, broadcast_type).then(res =\u003e {\n            if (res.code == 200) {\n                // ESPTouch success\n                console.log(res);\n            } else {\n                // ESPTouch failed\n                console.info(res.msg);\n            }\n        });\n    }\n\n    render() {\n        return (\n            \u003cView\u003e\n                \u003cText\u003e\n                    Lng: {this.state.lng} Lat: {this.state.lat}\n                \u003c/Text\u003e\n                \u003cButton title='test' onPress={this.onPress} /\u003e\n            \u003c/View\u003e\n        );\n    }\n}\n```\n\n## Licence\n\n[Licence](https://github.com/EspressifApp/EsptouchForIOS/blob/master/ESPRESSIF_MIT_LICENSE_V1.LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceamkrier%2Frn-esptouch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceamkrier%2Frn-esptouch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceamkrier%2Frn-esptouch/lists"}