fix android release pacckage not work

This commit is contained in:
lihang 2018-01-27 09:06:00 +08:00
parent cedce4832a
commit 72effbe06a
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { WebView, View, StyleSheet } from 'react-native';
import { WebView, View, StyleSheet, Platform } from 'react-native';
import renderChart from './renderChart';
import echarts from './echarts.min';
import PropTypes from "prop-types";
@ -32,7 +32,7 @@ export default class App extends Component {
backgroundColor: this.props.backgroundColor || 'transparent'
}}
scalesPageToFit={false}
source={require('./tpl.html')}
source={(Platform.OS == 'ios') ? require('./tpl.html') : {uri:'file:///android_asset/tpl.html'}}
onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}
{...this.props}
/>