Page MenuHomePhabricator

D4445.id14642.diff
No OneTemporary

D4445.id14642.diff

diff --git a/native/ios/Comm/AppDelegate.mm b/native/ios/Comm/AppDelegate.mm
--- a/native/ios/Comm/AppDelegate.mm
+++ b/native/ios/Comm/AppDelegate.mm
@@ -17,8 +17,10 @@
#import "CommCoreModule.h"
#import "GlobalNetworkSingleton.h"
#import "Logger.h"
+#import "MessageOperationsUtilities.h"
#import "NetworkModule.h"
#import "SQLiteQueryExecutor.h"
+#import "TemporaryMessageStorage.h"
#import "ThreadOperations.h"
#import "Tools.h"
#import <cstdio>
@@ -75,7 +77,7 @@
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif
-
+ [self moveMessagesToDatabase];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
@@ -261,6 +263,16 @@
comm::SQLiteQueryExecutor::initialize(sqliteFilePath);
}
+- (void)moveMessagesToDatabase {
+ TemporaryMessageStorage *temporaryStorage =
+ [[TemporaryMessageStorage alloc] init];
+ NSArray<NSString *> *messages = [temporaryStorage readAndClearMessages];
+ for (NSString *message in messages) {
+ std::string messageInfos = std::string([message UTF8String]);
+ comm::MessageOperationsUtilities::storeMessageInfos(messageInfos);
+ }
+}
+
// Copied from
// ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp
static ::hermes::vm::RuntimeConfig

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 7:13 AM (3 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2724577
Default Alt Text
D4445.id14642.diff (1 KB)

Event Timeline