tohu
23 Gennaio 2020, 9:09am
3
C’è un’app React Native che puoi utilizzare come riferimento per scoprire come eseguire l’accesso.
Questo file in particolare dovrebbe aiutarti a iniziare.
'use strict';
import {Platform} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
const site = 'https://' + global.siteDomain;
class Authenticate {
constructor() {}
login(username, password) {
return new Promise((resolve, reject) => {
this.getAbout()
.then((json) => {
// old version
if (json.about.version.startsWith('2.5')) {
this.getCSRF()
.then((json) => {
if (json.csrf) {
AsyncStorage.getItem('@Discourse.loginCookie').then(
(cookie) => {
This file has been truncated. show original