- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个用 Expo 和翼创建的应用程序,它有一个联系表格,可以从中发送查询。
我已经开始使用已经构建的应用程序,我只是在设置我的数据。
问题是发送的查询没有到达我在配置中建立的邮件,在一个文件 (config.php) 中,因此消息必须以 smtp 模式到达
这是我的服务器配置:
$emailConfig = array(
'address' => 'xxxxxxx',
'password' => 'xxxx',
'name' => 'jose',
'smtp_host' => 'smtp.xxxx.es',
'smtp_port' => '587',
'smtp_encrypt' => 'tls'
);
当我单击 SEND 时,应用程序调试控制台向我显示以下内容:
Toast is not defined
* application/components/PlaceFav.js:82:10 in render
- node_modules/react-native/node_modules/promise/setimmediate/core.js:37:11 in tryCallOne
- node_modules/react-native/node_modules/promise/setimmediate/core.js:123:14 in setImmediate$argument_0
- ... 8 more stack frames from framework internals
控制台输出引用的文件如下,行:
import React, {Component} from 'react';
import * as firebase from 'firebase';
import { NavigationActions, StackNavigator, withNavigation} from 'react-navigation';
import{AsyncStorage, TouchableOpacity, Dimensions, View, Image, ScrollView, FlatList} from 'react-native';
import Icon from 'react-native-vector-icons/SimpleLineIcons';
import { Container, Body, Thumbnail, Text, List, Right, ListItem} from 'native-base';
import ConfigApp from '../utils/ConfigApp';
import FavListEmpty from './FavListEmpty';
import Strings from '../utils/Strings';
var styles = require('../../assets/files/Styles');
var {height, width} = Dimensions.get('window');
class PlaceFav extends React.Component {
constructor(props) {
super(props);
this.state = {
places: []
}
}
componentDidMount () {
this.fetchPlaces();
}
PlaceDetails (item) {
const navigateAction = NavigationActions.navigate({
routeName: 'PlaceDetailsScreen',
params: {item}
});
this.props.navigation.dispatch(navigateAction);
}
renderFooterPlaces = () => {
const places = this.state.places
if (places.length != 0) return null;
return (
<FavListEmpty/>
);
};
removePlace = async (place_id) => {
try {
var user = firebase.auth().currentUser;
uid = user.uid;
const places = await AsyncStorage.getItem('places');
let placesFav = JSON.parse(places);
placesItems = placesFav.filter(function(e){ return e.place_id !== place_id && e.userId == uid })
await AsyncStorage.setItem('places', JSON.stringify(placesItems));
this.setState({
...this.state,
places: placesItems || []
});
} catch(error) {
}};
render () {
return (
<List>
<ListItem itemDivider>
<Text>{Strings.ST1}</Text>
</ListItem>
<FlatList
data={this.state.places}
refreshing="true"
renderItem={({item, index}) =>
<ListItem style={{paddingLeft: 0, marginLeft: 0, backgroundColor:'#FFF', opacity: 1, borderColor: 'rgba(0,0,0,0.05)', borderBottomWidth: 1}} onPress={() => this.PlaceDetails(item)} >
<Thumbnail rounded size={80} source={{ uri: ConfigApp.URL+'images/'+item.place_image }} style={{paddingLeft: 10, marginLeft: 10}} />
<Body style={{paddingLeft: 0, marginLeft: 0}}>
<Text numberOfLines={2} style={{fontSize: 14, marginBottom: 3}}>
{item.place_name}
</Text>
</Body>
<Right>
<TouchableOpacity onPress={this.removePlace.bind(this, item.place_id)} activeOpacity={1}>
<Text note>
<Icon name="close" style={{fontSize: 19}}/>
</Text>
</TouchableOpacity>
</Right>
</ListItem>
}
keyExtractor={(item, index) => index.toString()}
ListFooterComponent={this.renderFooterPlaces}
/>
</List>
)
}
async fetchPlaces () {
var user = firebase.auth().currentUser;
uid = user.uid;
let placesJSON= await AsyncStorage.getItem('places');
let placesFav = JSON.parse(placesJSON);
placesItems = placesFav.filter(function(e){
return e.userId == uid
})
const placesArray = placesItems || [];
this.setState({
...this.state,
places: placesArray
});
}
}
export default withNavigation(PlaceFav);
最佳答案
我终于发现了错误,初学者的错误
如果另一个用户和我发生同样的情况,我会解释一下。
问题是我没有编辑后端代码。我的意思是我在本地处理项目,后端在服务器上。
我修改了本地文件中的代码,但它没有将更新上传到服务器
这就是未发送来自应用程序的消息的原因
我希望这可以帮助其他人,这让我觉得您必须在寻求帮助和解决方案之前检查所有可能的错误。
感谢这个精彩的网站
关于javascript - 为什么我的 Expo 应用没有发送消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66569565/
我正在尝试设置 React 和 Expo monorepo 项目,一切似乎都很好,直到我想安装 react-navigation与 expo install根据 react-navigation 文档
我正在使用 expo-cli@3.0.10 此应用程序在安装在设备中的客户端博览会中运行良好 最佳答案 好的,我相信我找到了核心问题 - DNS 问题 . 无论您使用的是 Mac OS、Windows
如何在开发过程中获取重定向到 expo 应用程序的链接? 我有一个 React Native Expo 应用程序。在开发过程中以 èxpo start 开始。现在我喜欢使用 OAuth 2.0 身份验
为什么EXPO有两种通过Google进行身份验证的方式? 我不清楚expo-google-app-auth和expo-google-sign-in之间有什么区别。 在什么场合我应该使用哪一个? 最佳答
我正在使用 React Native 进行编码。当我第一次创建用于检查运行的 react native 应用程序时,我没有看到这一点。当我实现我的代码时看到这一点。我的目的是生成apk。 app.js
我已经在全局范围内安装了 expo-cli,但是当我尝试运行任何 expo 代码时,例如 expo start从任何地方,我得到:zsh: command not found: expoecho $P
我是react-native新手,我安装了expo,如下官方页面中提到的。 npm install expo-cli --global expo init my-new-project cd my-n
根据 Expo documentation with SQLite 我会这样查询: tx.executeSql(sqlStatement, arguments, success, error) 我是这
很多次我在启动 expo 项目后收到以下信息消息,似乎无法升级 expo-cli: 有一个新版本的 expo-cli 可用 (4.2.1)。您目前正在使用 expo-cli 3.28.0 使用您选择的
我已经使用 Expo 构建了一个应用程序,现在由于某些原因我想使用 expo eject 从 expo cli 中弹出该应用程序。我还能使用 Expo 套餐吗? 最佳答案 是的,Expo 包应该可以。
部署我的 Expo 网络项目时,我需要将一个文件添加到网络根目录(一个 Apple App 站点关联文件)。 Expo 开箱即用地支持此功能吗? 最佳答案 您所要做的就是在项目的根目录中创建一个名为“
我需要有关 expo xde 的帮助。 创建项目后,当我扫描二维码时,出现以下错误: there was a problem loading the experience. It looks like
我使用create-react-native-app创建了react-native项目。在此,我从 expo 导入权限模块, import {Permissions} from "expo"; 后来我
例如,如果我有组件: import React, { Component } from 'react'; import { Video } from 'expo'; let styles = requ
我将使用 Expo 制作一个应用程序,并与客户分享初步结果。我想告诉他们,这个世博应用程序反射(reflect)了最终的应用程序,它将作为独立的应用程序供我客户的客户一对一使用。 该应用程序的功能将是
When I run a Snack in the Expo Go app, is it doing anything more sophisticated than downloading t
我刚刚从 React 导航 5 升级到 6 并查看了 the doc for transparent modals .不幸的是,我无法让之前的屏幕显示在模态下。相反,我得到一个灰色背景。 我用我的代码
我尝试通过 expo 构建应用程序但失败了,我尝试重新安装 expo-cli。所以,我输入了下面的代码来删除 expo-cli。 npm -g uninstall expo-cli --save 和
我正在尝试运行我的 react-native 应用程序,我在 android 模拟器和我的手机 HUAWEI Y3II 上运行它,同样的事情发生了。 几天前我工作得很好,但突然这个错误不断出现:Cou
在 Expo 网络项目中是否有推荐的代码拆分方法? 我在文档中找不到任何内容,即使在网页性能页面上:https://docs.expo.io/guides/web-performance/ 我很惊讶,
我是一名优秀的程序员,十分优秀!