Skip to content

Commit

Permalink
Add comments to the cross-platform push token code in README (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-masseau authored Mar 8, 2024
1 parent 2eaabd1 commit 967f668
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@ In order to collect the APNs push token in your React Native code you need to:
try {
let deviceToken: string | null = null;
if (Platform.OS === 'android') {
// For Android, Klaviyo requires the FCM token
deviceToken = await messaging().getToken();
console.log('FCM Token:', deviceToken);
} else {
} else if (Platform.OS === 'ios') {
// For iOS, Klaviyo requires the APNs token
deviceToken = await messaging().getAPNSToken();
console.log('APNs Token:', deviceToken);
}
Expand Down

0 comments on commit 967f668

Please sign in to comment.