[Share extension] Track memory warning

This commit is contained in:
SBiOSoftWhare
2019-03-11 18:04:42 +01:00
parent f1d5cdcfc0
commit ac23ff6704
@@ -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