Skip to content

Commit

Permalink
fix: demo没录音权限
Browse files Browse the repository at this point in the history
  • Loading branch information
gdoudeng committed Sep 7, 2021
1 parent ae2c907 commit bcb6da2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example/src/HomeScreen.js
@@ -1,5 +1,6 @@
import React, {Component} from 'react';
import {
PermissionsAndroid,
ScrollView,
StyleSheet,
Text,
Expand All @@ -14,6 +15,16 @@ class HomeScreen extends Component {
{title: '语音合成', route: 'BaiduSynthesizer'},
];

componentDidMount() {
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO)
.then(result => {
console.log(result);
})
.catch(error => {
console.log(error);
});
}

handleItemPress = item => {
this.props.navigation.navigate(item.route);
};
Expand Down

0 comments on commit bcb6da2

Please sign in to comment.