Page MenuHomePhabricator

D4445.diff
No OneTemporary

D4445.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
@@ -263,6 +265,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
Tue, Nov 26, 1:26 AM (21 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581885
Default Alt Text
D4445.diff (1 KB)

Event Timeline