Asking for Notifications Permissions

#1

In my component, I have:

  componentDidMount(){
    this.setNotifications();
  }

and

  async setNotifications() {
    try {
      const localNotificationObject = { title: "hey", body: "hello"};
      const dateObject = { time: new Date(new Date().getTime() + 5000) };

      let result = await   
        Permissions.askAsync(Permissions.NOTIFICATIONS);
        if (result.status === 'granted') {
           await Notifications.scheduleLocalNotificationAsync(localNotification, dateObject)
        }
        console.log(result.status) // =>'undetermined'
    } catch(error) {console.log(error)}
  }

My iPhone simulator on the computer is not asking for notifications permissions at all, just immediately returning ‘undetermined’. Any help is appreciated.

#2

Notifications aren’t supported on the simulator, which is why you’re immediately getting “undetermined”.