TypeError: undefined is not a function (near '..._pushNotificationIos.default.localNotification...')
I code a minimal example to send local push notifications when the app dont run at the foreground.
This is the code in my App.js
I add the library like descripted in the README.md.
Has anyone had this error before or knows what this could be? I have expanded the respective AppDelegates, and executed a "pod install". The React native version is 0.66.4
`
import React, {useRef, useState, useEffect} from "react";
import {StyleSheet, Text, View, AppState} from "react-native";
import PushNotificationIOS from '@react-native-community/push-notification-ios';
I get the following error.
TypeError: undefined is not a function (near '..._pushNotificationIos.default.localNotification...')
I code a minimal example to send local push notifications when the app dont run at the foreground.
This is the code in my App.js
I add the library like descripted in the README.md.
Has anyone had this error before or knows what this could be? I have expanded the respective AppDelegates, and executed a "pod install". The React native version is 0.66.4
` import React, {useRef, useState, useEffect} from "react"; import {StyleSheet, Text, View, AppState} from "react-native"; import PushNotificationIOS from '@react-native-community/push-notification-ios';
const App = () => { const appState = useRef(AppState.currentState); const [appStateVisible, setAppStateVisible] = useState(appState.current);
};
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center", }, textStyle: { textAlign: "center", fontSize: 30, color: "black" } });
export default App;
`