Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ios/NotifeeCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>NotifeeCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreEventType) {

@protocol NotifeeCoreDelegate <NSObject>
@optional
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event;
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event foreground:(BOOL)foreground;
@end

@interface NotifeeCore : NSObject
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreEventType) {

@protocol NotifeeCoreDelegate <NSObject>
@optional
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event;
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event foreground:(BOOL)foreground;
@end

@interface NotifeeCore : NSObject
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dict>
<key>Headers/NotifeeCore.h</key>
<data>
Bw5ygMCtWPTJENK7K+7ufpFC+O4=
8mYCTy9qRvV7N2iLL6tOOaAZUYU=
</data>
<key>Info.plist</key>
<data>
Expand All @@ -23,11 +23,11 @@
<dict>
<key>hash</key>
<data>
Bw5ygMCtWPTJENK7K+7ufpFC+O4=
8mYCTy9qRvV7N2iLL6tOOaAZUYU=
</data>
<key>hash2</key>
<data>
FGqqE208vli0ZHW09ph44+F6GkRNCDkTZRFrQSkfHvU=
onLq0FNJNbhWALkP7G8BqLjNhUGddQXK/XqTYAZFwvo=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreEventType) {

@protocol NotifeeCoreDelegate <NSObject>
@optional
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event;
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event foreground:(BOOL)foreground;
@end

@interface NotifeeCore : NSObject
Expand Down
Binary file not shown.
16 changes: 6 additions & 10 deletions ios/RNNotifee/NotifeeApiModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ - (id)init {
- (void)startObserving {
hasListeners = YES;
for (NSDictionary *eventBody in pendingCoreEvents) {
[self sendNotifeeCoreEvent:eventBody];
BOOL *foreground = [UIApplication sharedApplication].applicationState == UIApplicationStateActive;
[self sendNotifeeCoreEvent:eventBody foreground: foreground];
}
[pendingCoreEvents removeAllObjects];
}
Expand All @@ -70,26 +71,21 @@ + (BOOL)requiresMainQueueSetup {

#pragma mark - Events

- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event {
- (void)didReceiveNotifeeCoreEvent:(NSDictionary *_Nonnull)event foreground: (BOOL)foreground; {
if (hasListeners) {
[self sendNotifeeCoreEvent:event];
[self sendNotifeeCoreEvent:event foreground:foreground];
} else {
[pendingCoreEvents addObject:event];
}
}

- (void)sendNotifeeCoreEvent:(NSDictionary *_Nonnull)eventBody {
dispatch_after(
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (RCTRunningInAppExtension() ||
[UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
- (void)sendNotifeeCoreEvent:(NSDictionary *_Nonnull)eventBody foreground: (BOOL)foreground; {
if (RCTRunningInAppExtension() || !foreground ) {
[self sendEventWithName:kReactNativeNotifeeNotificationBackgroundEvent body:eventBody];
} else {
[self sendEventWithName:kReactNativeNotifeeNotificationEvent body:eventBody];
}
});
}

// TODO(helenaford): look into a custom format style for React Native Method signatures
// clang-format off

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@notifee/react-native",
"version": "1.9.1",
"version": "1.11.0-alpha.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "Notifee - a feature rich notifications library for React Native.",
"main": "dist/index.js",
Expand Down