Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33124738
D4063.1768494229.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4063.1768494229.diff
View Options
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,7 +21,21 @@
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::storeNotification(rawMessageInfosStdStr);
+ } else if (rawMessageInfosString) {
+ comm::Logger::log("Database not existing yet. Skipping notification");
+ } else {
+ comm::Logger::log("Received notification without messageInfos field");
+ }
self.contentHandler(self.bestAttemptContent);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 15, 4:23 PM (1 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5938819
Default Alt Text
D4063.1768494229.diff (1 KB)
Attached To
Mode
D4063: Use notification service on ios to store notification in sqlite
Attached
Detach File
Event Timeline
Log In to Comment