diff --git a/RNNotifications/RCTConvert+RNNotifications.m b/RNNotifications/RCTConvert+RNNotifications.m index ce065cfb2951b5819290a9f61a3f2af3a7bb02c4..d499892116461017d19d9a4939f6a0caf639733e 100644 --- a/RNNotifications/RCTConvert+RNNotifications.m +++ b/RNNotifications/RCTConvert+RNNotifications.m @@ -109,7 +109,8 @@ formattedNotification[@"body"] = RCTNullIfNil(content.body); formattedNotification[@"category"] = RCTNullIfNil(content.categoryIdentifier); formattedNotification[@"thread"] = RCTNullIfNil(content.threadIdentifier); - formattedNotification[@"data"] = [NSDictionary dictionaryWithDictionary:RCTNullIfNil(RCTJSONClean(content.userInfo))]; + + [formattedNotification addEntriesFromDictionary:[NSDictionary dictionaryWithDictionary:RCTNullIfNil(RCTJSONClean(content.userInfo))]]; return formattedNotification; } diff --git a/example/index.ios.js b/example/index.ios.js index 0e2dc641acffa2bcd9ebf73da2ac07d0f2b8c3ed..844428056ca5cdad18e24ffd62266f4fa459819c 100644 --- a/example/index.ios.js +++ b/example/index.ios.js @@ -16,12 +16,13 @@ class NotificationsExampleApp extends Component { }; this.registerNotificationEvents(); + this.setCategories(); } registerNotificationEvents() { Notifications.events().registerNotificationReceived((notification, completion) => { this.setState({ - notifications: [...this.state.notifications, notification.data.link] + notifications: [...this.state.notifications, notification.link] }); completion({alert: true, sound: false, badge: false}); @@ -29,7 +30,7 @@ class NotificationsExampleApp extends Component { Notifications.events().registerRemoteNotificationOpened((response, completion) => { this.setState({ - notifications: [...this.state.notifications, `Notification Clicked: ${response.notification.data.link}`] + notifications: [...this.state.notifications, `Notification Clicked: ${response.notification.link}`] }); completion(); @@ -87,7 +88,7 @@ class NotificationsExampleApp extends Component { async componentDidMount() { const initialNotification = await Notifications.getInitialNotification(); if (initialNotification) { - this.setState({notifications: [initialNotification.data.link, ...this.state.notifications]}); + this.setState({notifications: [initialNotification.link, ...this.state.notifications]}); } }