Commit 4520e23b authored by yogevbd's avatar yogevbd

Fix e2e

parent 1c606aaa
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
formattedNotification[@"body"] = RCTNullIfNil(content.body); formattedNotification[@"body"] = RCTNullIfNil(content.body);
formattedNotification[@"category"] = RCTNullIfNil(content.categoryIdentifier); formattedNotification[@"category"] = RCTNullIfNil(content.categoryIdentifier);
formattedNotification[@"thread"] = RCTNullIfNil(content.threadIdentifier); formattedNotification[@"thread"] = RCTNullIfNil(content.threadIdentifier);
formattedNotification[@"data"] = [NSDictionary dictionaryWithDictionary:RCTNullIfNil(RCTJSONClean(content.userInfo))];
[formattedNotification addEntriesFromDictionary:[NSDictionary dictionaryWithDictionary:RCTNullIfNil(RCTJSONClean(content.userInfo))]];
return formattedNotification; return formattedNotification;
} }
......
...@@ -16,12 +16,13 @@ class NotificationsExampleApp extends Component { ...@@ -16,12 +16,13 @@ class NotificationsExampleApp extends Component {
}; };
this.registerNotificationEvents(); this.registerNotificationEvents();
this.setCategories();
} }
registerNotificationEvents() { registerNotificationEvents() {
Notifications.events().registerNotificationReceived((notification, completion) => { Notifications.events().registerNotificationReceived((notification, completion) => {
this.setState({ this.setState({
notifications: [...this.state.notifications, notification.data.link] notifications: [...this.state.notifications, notification.link]
}); });
completion({alert: true, sound: false, badge: false}); completion({alert: true, sound: false, badge: false});
...@@ -29,7 +30,7 @@ class NotificationsExampleApp extends Component { ...@@ -29,7 +30,7 @@ class NotificationsExampleApp extends Component {
Notifications.events().registerRemoteNotificationOpened((response, completion) => { Notifications.events().registerRemoteNotificationOpened((response, completion) => {
this.setState({ this.setState({
notifications: [...this.state.notifications, `Notification Clicked: ${response.notification.data.link}`] notifications: [...this.state.notifications, `Notification Clicked: ${response.notification.link}`]
}); });
completion(); completion();
...@@ -87,7 +88,7 @@ class NotificationsExampleApp extends Component { ...@@ -87,7 +88,7 @@ class NotificationsExampleApp extends Component {
async componentDidMount() { async componentDidMount() {
const initialNotification = await Notifications.getInitialNotification(); const initialNotification = await Notifications.getInitialNotification();
if (initialNotification) { if (initialNotification) {
this.setState({notifications: [initialNotification.data.link, ...this.state.notifications]}); this.setState({notifications: [initialNotification.link, ...this.state.notifications]});
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment