Skip to content

Commit 0835ea4

Browse files
committed
Allow developer to request push notifications permissions
1 parent e3cd228 commit 0835ea4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ios/src/ESFBMessaging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@property (assign) BOOL tokenChangedListener;
1616
@property (assign) BOOL instanceIdChangedListener;
1717
@property (assign) BOOL messageListener;
18-
+ (void)registerForNotifiations;
18+
- (void)registerForNotifications;
1919
+ (void)notificationReceived:(NSDictionary *)data;
2020
+ (void)setLaunchData:(NSDictionary *)launchOptions;
2121
@end

src/ios/src/ESFBMessaging.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ - (instancetype)initWithObjectId:(NSString *)objectId properties:(NSDictionary *
4747
if (self) {
4848
messagingDelegate.instance = self;
4949
[self registerSelector:@selector(resetInstanceId) forCall:@"resetInstanceId"];
50+
[self registerSelector:@selector(registerForNotifications) forCall:@"requestPermissions"];
5051
}
5152
return self;
5253
}
@@ -89,7 +90,7 @@ - (UIView *)view {
8990

9091
+ (void)setup {
9192
[ESFirebaseHelper setup];
92-
[ESFBMessaging registerForNotifiations];
93+
messagingDelegate = [ESFBMessagingDelegate new];
9394
}
9495

9596
- (NSString *)instanceId {
@@ -100,8 +101,7 @@ - (NSString *)token {
100101
return [FIRMessaging messaging].FCMToken;
101102
}
102103

103-
+ (void)registerForNotifiations {
104-
messagingDelegate = [ESFBMessagingDelegate new];
104+
- (void)registerForNotifications {
105105
[messagingDelegate registerForNotifications];
106106
}
107107

0 commit comments

Comments
 (0)