Skip to content

Commit

Permalink
Update push notification registration instructions for SDK8
Browse files Browse the repository at this point in the history
fbshipit-source-id: fd2ee9d
  • Loading branch information
brentvatne authored and expbot committed Aug 2, 2016
1 parent 38cebe3 commit c125cdc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions api/registerForPushNotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import {
const PUSH_ENDPOINT = 'https://exponent-push-server.herokuapp.com/tokens';

export default async function registerForPushNotificationsAsync() {
// This is only necessary on iOS because we get permissions when we install the
// app on Android
if (Platform.OS === 'ios') {
let { status } = await Permissions.askAsync(Permissions.REMOTE_NOTIFICATIONS);
// Android remote notification permissions are granted during the app
// install, so this will only ask on iOS
let { status } = await Permissions.askAsync(Permissions.REMOTE_NOTIFICATIONS);

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

// Get the token that uniquely identifies this device
Expand Down

0 comments on commit c125cdc

Please sign in to comment.