React-native-push-notification: PushNotificationIOs is not defined

Created on 5 Apr 2018  路  3Comments  路  Source: zo0r/react-native-push-notification

captura de pantalla 2018-04-05 a la s 12 00 39

Emulator: iPhone 6
Xcode Version: 9.2
react: 16.0.0
react-native: 0.50.3
react-native-push-notification: ^3.0.2

captura de pantalla 2018-04-05 a la s 12 06 14

the error line is in notification.finish(PushNotificationIOS.FetchResult.NoData);

i import configuration in AppDelegate.m

Most helpful comment

Sorry, the error is don't implement PushNotificationIOS in de import from react-native

import { View, Text, StyleSheet, Image, Button, PushNotificationIOS } from 'react-native';

fixed

All 3 comments

Sorry, the error is don't implement PushNotificationIOS in de import from react-native

import { View, Text, StyleSheet, Image, Button, PushNotificationIOS } from 'react-native';

fixed

I have got the same error message when I'm running RN android project. Don't know why getting this even without running the iOS project of RN app.

I have got the same error message when I'm running RN android project. Don't know why getting this even without running the iOS project of RN app.

If you are using iOS only method on android add logic to not execute it when Platform.OS == 'android'
in my case, I was using notification.finish(PushNotificationIOS.FetchResult.NoData);

Was this page helpful?
0 / 5 - 0 ratings