Merge pull request #2325 from vector-im/share_extension_memory_warning

[Share extension] Track memory warning
This commit is contained in:
SBiOSoftWhare
2019-03-11 18:09:53 +01:00
committed by GitHub
@@ -67,6 +67,9 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
// Add observer on the Extension host
[[NSNotificationCenter defaultCenter] addObserver:sharedInstance selector:@selector(checkUserAccount) name:NSExtensionHostWillEnterForegroundNotification object:nil];
// Add observer to handle memory warning
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance];
// Apply the application group
sdkOptions.applicationGroupIdentifier = @"group.im.vector";
@@ -840,6 +843,11 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
}
}
- (void)didReceiveMemoryWarning:(NSNotification*)notification
{
NSLog(@"[ShareExtensionManager] Did receive memory warning");
}
#pragma mark - Sharing
- (void)sendText:(NSString *)text toRoom:(MXRoom *)room successBlock:(dispatch_block_t)successBlock failureBlock:(void(^)(NSError *error))failureBlock