|
@@ -40,6 +40,8 @@
|
|
|
@property (nonatomic, strong) JSGController * _Nullable jsyuyinctr;
|
|
@property (nonatomic, strong) JSGController * _Nullable jsyuyinctr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+@property (nonatomic) BOOL isNotification;
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
@implementation AppDelegate
|
|
@@ -49,6 +51,7 @@
|
|
|
// Override point for customization after application launch.
|
|
// Override point for customization after application launch.
|
|
|
app = self;
|
|
app = self;
|
|
|
self.isJitsiMeet=false;
|
|
self.isJitsiMeet=false;
|
|
|
|
|
+ _isNotification=false;
|
|
|
self.shouldShowLock = YES;
|
|
self.shouldShowLock = YES;
|
|
|
[self initJSMSDK];
|
|
[self initJSMSDK];
|
|
|
[self setupListener];
|
|
[self setupListener];
|
|
@@ -75,12 +78,16 @@
|
|
|
NSLog(@"applicationDidBecomeActive");
|
|
NSLog(@"applicationDidBecomeActive");
|
|
|
if(self.isLogin){
|
|
if(self.isLogin){
|
|
|
[self sartWebsocket];
|
|
[self sartWebsocket];
|
|
|
-
|
|
|
|
|
if(self.isJitsiMeet){
|
|
if(self.isJitsiMeet){
|
|
|
[_floatWindow viewInFload:0];
|
|
[_floatWindow viewInFload:0];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
[self showLockScreen];
|
|
[self showLockScreen];
|
|
|
|
|
+ if(!_isNotification){
|
|
|
|
|
+ if ([[self.window jk_currentViewController] isKindOfClass:ChatController.class]) {
|
|
|
|
|
+ ChatController * currentChatVc = (ChatController *)[self.window jk_currentViewController];
|
|
|
|
|
+ [currentChatVc reloadAllData];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[self startTimer];
|
|
[self startTimer];
|
|
@@ -88,6 +95,7 @@
|
|
|
}
|
|
}
|
|
|
-(void)applicationDidEnterBackground:(UIApplication *)application{
|
|
-(void)applicationDidEnterBackground:(UIApplication *)application{
|
|
|
NSLog(@"applicationDidEnterBackground");
|
|
NSLog(@"applicationDidEnterBackground");
|
|
|
|
|
+ _isNotification=false;
|
|
|
// [self endWebsocket];
|
|
// [self endWebsocket];
|
|
|
__block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
|
|
__block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
|
|
|
[application endBackgroundTask:bgTask];
|
|
[application endBackgroundTask:bgTask];
|
|
@@ -595,7 +603,7 @@
|
|
|
- (void)handleNotification:(NSDictionary *)userInfo {
|
|
- (void)handleNotification:(NSDictionary *)userInfo {
|
|
|
NSDictionary * tempDict = userInfo[@"imMsg"];
|
|
NSDictionary * tempDict = userInfo[@"imMsg"];
|
|
|
NSDictionary * imMsg = tempDict[@"message"];
|
|
NSDictionary * imMsg = tempDict[@"message"];
|
|
|
-
|
|
|
|
|
|
|
+ _isNotification=true;
|
|
|
NSMutableDictionary * mutablemsg = imMsg.mutableCopy;
|
|
NSMutableDictionary * mutablemsg = imMsg.mutableCopy;
|
|
|
NSLog(@"------mutablemsg:%@",mutablemsg);
|
|
NSLog(@"------mutablemsg:%@",mutablemsg);
|
|
|
NSDictionary * user = [UDManager.shareInstance getDDManager:dkuserinfo];
|
|
NSDictionary * user = [UDManager.shareInstance getDDManager:dkuserinfo];
|