mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
[ReactNative] pass in launchOptions to relevant bridged modules
This commit is contained in:
parent
63ab6e8281
commit
824da1bada
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
@interface RCTPushNotificationManager : NSObject <RCTBridgeModule>
|
@interface RCTPushNotificationManager : NSObject <RCTBridgeModule>
|
||||||
|
|
||||||
- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
|
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
|
||||||
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification;
|
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification;
|
||||||
|
|
||||||
|
@ -24,14 +24,8 @@ RCT_EXPORT_MODULE()
|
|||||||
@synthesize bridge = _bridge;
|
@synthesize bridge = _bridge;
|
||||||
|
|
||||||
- (instancetype)init
|
- (instancetype)init
|
||||||
{
|
|
||||||
return [self initWithInitialNotification:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification
|
|
||||||
{
|
{
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_initialNotification = [initialNotification copy];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector:@selector(handleRemoteNotificationReceived:)
|
selector:@selector(handleRemoteNotificationReceived:)
|
||||||
name:RCTRemoteNotificationReceived
|
name:RCTRemoteNotificationReceived
|
||||||
@ -45,6 +39,12 @@ RCT_EXPORT_MODULE()
|
|||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setBridge:(RCTBridge *)bridge
|
||||||
|
{
|
||||||
|
_bridge = bridge;
|
||||||
|
_initialNotification = [bridge.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] copy];
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
||||||
{
|
{
|
||||||
if ([application respondsToSelector:@selector(registerForRemoteNotifications)]) {
|
if ([application respondsToSelector:@selector(registerForRemoteNotifications)]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user