But when I install this fork in ios crash the app...
It's my code:
react-native-cli: 2.0.1react-native: 0.61.2
App.js
const App = () => {
var PushNotification = require("react-native-push-notification");
PushNotification.configure({
// (optional) Called when Token is generated (iOS and Android)
onRegister: function(token) {
console.log("TOKEN:", token);
},
// (required) Called when a remote or local notification is opened or received
onNotification: function(notification) {
console.log("NOTIFICATION:", notification);
// process the notification
// required on iOS only (see fetchCompletionHandler docs: https://github.com/react-native-community/react-native-push-notification-ios)
notification.finish(PushNotification.FetchResult.NoData);
},
// ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for local notifications, but is need to receive remote push notifications)
senderID: "YOUR GCM (OR FCM) SENDER ID",
// IOS ONLY (optional): default: all - Permissions to register.
permissions: {
alert: true,
badge: true,
sound: true
},
// Should the initial notification be popped automatically
// default: true
popInitialNotification: true,
requestPermissions: true
});
Page with notification:
import PushNotification from 'react-native-push-notification';
class Registre extends React.Component {
constructor(props) {
super(props);
PushNotification.localNotificationSchedule({
//... You can use all the options from localNotifications
smallIcon: "icon_black",
soundName: "customnotify.mp3",
message: "Hi!", // (required)
date: new Date(Date.now() + 3 * 1000) // in 60 secs
});
}
Let's see if you can update the repository I fix it thanks.
Hi!
I was local notifications with localNotificationSchedule, but soundName only found with IOS
I found a solution for android in this fork: https://github.com/MaximusBaton/react-native-push-notification
But when I install this fork in ios crash the app...
It's my code:
react-native-cli: 2.0.1
react-native: 0.61.2
App.js
Page with notification:
Let's see if you can update the repository I fix it thanks.