A Wikia chat client for React Native. Fork of Gekkou.
Requirements
- NodeJS
- React Native (Tested with version 0.52.0, it should work with other versions too).
Note that this library doesn't have any native dependencies, this means you can use it with a CRNA or Expo project.
Installation
Add the package to your project:
Using Yarn: yarn add gekkou-react-native
Using NPM: npm install --save gekkou-react-native
Gekkou
Differences from core- Replaced the
request
module with the React Nativefetch
API. - The way you log in has changed a bit. In core Gekkou, you use
new Client('username', 'password').
Here you can log in two ways:
Logging in with a password
globalclient = username: 'Wikia username' password: 'Wikia password';
Logging in with an access_token
This is specially useful if you, for example, ask for the user's credentials on a login screen and validate them there. This way, if you save the access token returned by https://services.wikia.com/auth/token
, you can use it to log in and avoid checking the credentials twice. This translates in less network requests, and a faster application.
globalclient = username: 'Wikia username' token: 'access token';
Example: Ping Pong
;;; Component { globalclient = username: 'Wikia username' password: 'Wikia password' ; client; client; client; }
More examples can be found in the examples folder.