[ReactNative|MAdMan] Notification Subscribable

This commit is contained in:
Eric Vicenti 2015-03-11 13:25:40 -07:00
parent 221ddd3cfe
commit 30d3117f96
1 changed files with 11 additions and 1 deletions

View File

@ -5,6 +5,7 @@
*/
'use strict';
var PushNotificationIOS = require('PushNotificationIOS');
var React = require('React');
var invariant = require('invariant');
@ -14,7 +15,16 @@ function renderApplication(RootComponent, initialProps, rootTag) {
rootTag,
'Expect to have a valid rootTag, instead got ', rootTag
);
React.render(<RootComponent {...initialProps} />, rootTag);
var pushNotification = initialProps.launchOptions &&
initialProps.launchOptions.remoteNotification &&
new PushNotificationIOS(initialProps.launchOptions.remoteNotification);
React.render(
<RootComponent
pushNotification={pushNotification}
{...initialProps}
/>,
rootTag
);
}
module.exports = renderApplication;