Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native TypeError:Notifications.scheduleNotificationAsync不是函数_React Native_Expo_Expo Notifications - Fatal编程技术网

React native TypeError:Notifications.scheduleNotificationAsync不是函数

React native TypeError:Notifications.scheduleNotificationAsync不是函数,react-native,expo,expo-notifications,React Native,Expo,Expo Notifications,我第一次尝试世博会通知。我遇到一个错误,上面写着TypeError:Notifications.scheduleNotificationAsync不是一个函数 这是我的密码: import * as Notifications from 'expo'; enableNotifications = () =>{ Notifications.scheduleNotificationAsync({ content : { title : 'Notificatio

我第一次尝试世博会通知。我遇到一个错误,上面写着TypeError:Notifications.scheduleNotificationAsync不是一个函数

这是我的密码:

import * as Notifications from 'expo';

enableNotifications = () =>{
 Notifications.scheduleNotificationAsync({ 
      content : {
        title : 'Notification',
        body : 'This is a notification'
      }
    })
}

提前谢谢。

您能为同样的问题提供更多的代码片段吗。看起来您没有正确导入函数。导入语句必须类似于“expo Notifications”中的
import*as通知我已从世博会导入通知,是否应将其更改为世博会通知?