An open API service indexing awesome lists of open source software.

https://github.com/jerp86/postmessagewithwebview

Project is to demonstrate in a simple way how it is possible to have text and/or object communication between a Native/Hybrid app and a website, through window.postMessage().
https://github.com/jerp86/postmessagewithwebview

postmessage postmessage-api react-native react-native-example react-native-webview react-native-webview-bridge

Last synced: about 1 month ago
JSON representation

Project is to demonstrate in a simple way how it is possible to have text and/or object communication between a Native/Hybrid app and a website, through window.postMessage().

Awesome Lists containing this project

README

          

postMessage with WebView

---





License

---


Sobre | 
Motivo | 
Requisitos



Tecnologias | 
Como baixar o projeto | 
Licença

---


app's main screen, with two buttons
alert message after clicking the 1st button
alert message after clicking the 2nd button

## :information_source: Sobre

Projeto trata de demostrar de forma simples como é possível haver comunicação de texto e/ou objetos entre um app Nativo/Híbrido e um site, através do window.postMessage().

## :interrobang: Motivo

Enquanto era produzido um WebApp que será chamado em uma WebView nativa (Android e iOS), foi detectado a necessidade de troca de informações entre o Nativo e WebApp.

## :seedling: Requisitos Mínimos

[NodeJS](https://nodejs.org/en/)

## :rocket: Tecnologias Utilizadas

O projeto foi desenvolvido utilizando as seguintes tecnologias

- [Expo](https://expo.dev/)
- [React Native](https://reactnative.dev/)
- [React Native WebView](https://github.com/react-native-webview/react-native-webview#readme)
- [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)

## :package: Como baixar o projeto

Para copiar o projeto, utilize os comandos:

```bash
# Clonar o repositório
❯ git clone https://github.com/jerp86/postMessageWithWebView.git

# Entrar no diretório
❯ cd postMessageWithWebView
```

Para instalar as dependências e iniciar o projeto, você pode utilizar o Yarn ou NPM:

**Utilizando yarn**

```bash
# Instalar as dependências
❯ yarn

# Iniciar o projeto
❯ yarn start
```

**Utilizando npm**

_PS: Caso utilize o NPM, apague o arquivo `yarn.lock` para ter todas as dependências instaladas da melhor forma._

```bash
# Instalar as dependências
❯ npm install

# Iniciar o projeto
❯ npm start
```

## :memo: Licença

Esse projeto está sob a licença MIT. Veja o arquivo [LICENSE](LICENSE) para mais detalhes.

---


Feito com ❤️ por Jerp86 👋️ Entre em contato!



José Eduardo Rodrigues Pinto


José Eduardo Rodrigues Pinto