使用delete()反应本机推送通知

时间:2020-11-02 10:03:26

标签: react-native react-native-firebase react-native-push-notification

我正在使用react-native-firebase学习react-native-push-notifications。我想在删除用户时收到推送通知。删除工作正常。但是,在线上几个教程并做不同的事情,我无法收到通知。有人可以指导我如何更改此设置,以便在单击“删除用户”时也获得推送通知吗?预先感谢。

export default class UpdateInfo extends Component {  
  constructor() {
    super();
    this.state = { 
      displayName: '',
      email: '', 
      isLoading: false
    }
  }
    deleteUser = () => {
      firebase.auth().currentUser.delete().then(() => {
        console.log("The user was deleted successfully")
      }).catch(function (error) {
        console.error({error})
      })
    }

  render() {
    if(this.state.isLoading){
      return(
        <View>
          <ActivityIndicator size="large" color="#9E9E9E"/>
        </View>
      )
    }    
    
    return (
      <View>
        <TouchableOpacity 
          onPress={() => this.deleteUser()}
          >
          <Text>DELETE USER</Text>
        </TouchableOpacity>
      </View>

    );
  }
}

0 个答案:

没有答案