APPdelegateModularForData.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // APPdelegateModularForData.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2019/3/26.
  6. // Copyright © 2019 JCZ. All rights reserved.
  7. //
  8. #import "APPdelegateModularForData.h"
  9. #import "RQAppEventAnnotation.h"
  10. RQAppEventMod(APPdelegateModularForData)
  11. @implementation APPdelegateModularForData
  12. - (NSInteger)moduleLevel {
  13. return 1;
  14. }
  15. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  16. [self initMudule];
  17. // [self destroyModule];
  18. return YES;
  19. }
  20. - (void)initMudule {
  21. //同步本地数据
  22. [UserInfo shareInfo];
  23. if (defUser.userDict) {
  24. myDelegate.isLogin = YES;
  25. // defUser.car_type = defUser.userDict[@"car_type"];
  26. }
  27. //默认科目一
  28. if (!myDelegate.subject) {
  29. myDelegate.subject = @"1";
  30. }
  31. //异步获取新的广告
  32. [jiaPeiManager requestADImage];
  33. //判断跳转页面 这样每次更新版本 都会有导航页
  34. NSString *vesionNow = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
  35. if (![defUser.isWelcomed isEqualToString:vesionNow]) {
  36. [[NSUserDefaults standardUserDefaults] setBool:NO forKey:BOOLFORKEY];
  37. defUser.isWelcomed = vesionNow;
  38. //如果更新了数据库 运行的时候要加上下面这句代码 提取旧库数据 移除旧的数据库 重新copy到document文件目录下
  39. [DB_Que_Helper getDataFormLastDB];
  40. myDelegate.isSyn = YES;
  41. } else {
  42. }
  43. }
  44. @end