are the expo docs up to date?

I followed the docs for the Notifications but I couldn’t get the Token (part 1). I’m just wondering if these docs are up to date. Here is my code:

import { Permissions, Notifications } from 'expo';

const PUSH_ENDPOINT = 'https://your-server.com/users/push-token';

export async function registerForPushNotificationsAsync() {
  const { status: existingStatus } = await Permissions.getAsync(
    Permissions.NOTIFICATIONS
  );
  let finalStatus = existingStatus;

  // only ask if permissions have not already been determined, because
  // iOS won't necessarily prompt the user a second time.
  if (existingStatus !== 'granted') {
    // Android remote notification permissions are granted during the app
    // install, so this will only ask on iOS
    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
    finalStatus = status;
  }

  // Stop here if the user did not grant permissions
  if (finalStatus !== 'granted') {
    return;
  }

  // Get the token that uniquely identifies this device
  let token = await Notifications.getExpoPushTokenAsync();
  console.log("im the token: ", token);
}

Hey @wilfredo789,

A very simple way to test this is by throwing your code into a Snack http://snack.expo.io Can you do that for me so I can try and see if there is something wrong?

All the best,

Adam

Closing in favor of I can't get the Token for the notifications - #2 by adamjnav