Page MenuHomePhabricator

D4063.diff
No OneTemporary

D4063.diff

diff --git a/native/ios/NotificationService/NotificationService.mm b/native/ios/NotificationService/NotificationService.mm
--- a/native/ios/NotificationService/NotificationService.mm
+++ b/native/ios/NotificationService/NotificationService.mm
@@ -1,4 +1,7 @@
#import "NotificationService.h"
+#import "../Comm/Tools.h"
+#import "Logger.h"
+#import "MessageOperationsUtilities.h"
@interface NotificationService ()
@@ -18,6 +21,19 @@
self.bestAttemptContent = [request.content mutableCopy];
// TODO modify self.bestAttemptContent here
+ NSString *rawMessageInfosString =
+ self.bestAttemptContent.userInfo[@"messageInfos"];
+ NSString *sqliteFilePath = [Tools getSQLiteFilePath];
+
+ if (rawMessageInfosString &&
+ [NSFileManager.defaultManager fileExistsAtPath:sqliteFilePath]) {
+ std::string sqliteFilePathStdStr = [sqliteFilePath UTF8String];
+ std::string rawMessageInfosStdStr = [rawMessageInfosString UTF8String];
+ comm::SQLiteQueryExecutor::initialize(sqliteFilePathStdStr);
+ comm::MessageOperationsUtilities::storeMessageInfos(rawMessageInfosStdStr);
+ } else if (rawMessageInfosString) {
+ comm::Logger::log("Database not existing yet. Skipping notification");
+ }
self.contentHandler(self.bestAttemptContent);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 12:26 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581779
Default Alt Text
D4063.diff (1 KB)

Event Timeline