PDRCoreAppManager.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // PDR_Application.h
  3. // Pandora
  4. //
  5. // Created by Mac Pro on 12-12-22.
  6. // Copyright 2012 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "PDRCoreApp.h"
  10. @class PDRCoreAppCongfigParse;
  11. @protocol PDRCoreAppWindowDelegate;
  12. @protocol H5UniversalApp;
  13. NS_ASSUME_NONNULL_BEGIN
  14. ///APP启动成功
  15. extern NSString *const PDRCoreAppDidLoadNotificationKey;
  16. ///APP启动失败
  17. extern NSString *const PDRCoreAppDidStartedFailedKey;
  18. extern NSString *const PDRCoreAppDidSplashCloseKey;
  19. /// 应用管理模块
  20. @interface PDRCoreAppManager : NSObject
  21. /// 当前激活的应用
  22. @property (nonatomic, readonly)H5UniversalApp *activeApp;
  23. - (int)startApp:(NSString*)appid
  24. withOptions:(DC5PAppStartParams*__nullable)startParams;
  25. ///查询应用
  26. - (H5UniversalApp*__nullable)getAppByID:(NSString*)appid;
  27. - (H5UniversalApp*)getMainApp;
  28. - (NSUInteger)appCount;
  29. ///重启指定应用
  30. - (void)restart:(H5UniversalApp*)coreApp;
  31. - (void)restartWithAppid:(NSString*)appId;
  32. - (BOOL)activeWithAppId:(NSString*)appId;
  33. /// 关闭指定的应用
  34. - (void)endTopApp;
  35. - (void)endAllApp;
  36. - (void)end:(H5UniversalApp*)coreApp;
  37. - (void)end:(H5UniversalApp*)coreApp animated:(BOOL)animated;
  38. /// 关闭指定的应用
  39. - (void)endWithAppid:(NSString*)appId;
  40. - (void)endWithAppid:(NSString*)appId animated:(BOOL)animated;
  41. - (NSArray<H5UniversalApp*>*)getAllApps;
  42. /**
  43. 创建App
  44. @param appId appId
  45. @param args 传入启动参数,可以在页面中通过 plus.runtime.arguments 参数获取
  46. @param delegate 代理
  47. @return PDRCoreApp实例对象
  48. */
  49. - (PDRCoreApp*)openAppWithAppid:(NSString*)appId
  50. withArgs:(NSString*__nullable)args
  51. withDelegate:(id<PDRCoreAppWindowDelegate>__nullable)delegate;
  52. - (PDRCoreAppInfo*)getMainAppInfo;
  53. //打开完整的5+App应用
  54. - (PDRCoreApp*)openAppAtLocation:(NSString*)location
  55. withAppId:(NSString*__nullable)appid
  56. withArgs:(NSString*__nullable)args
  57. withDelegate:(id<PDRCoreAppWindowDelegate>__nullable)delegate __attribute__((deprecated("deprecated, Use -openAppWithAppid:withArgs:withDelegate:")));
  58. - (PDRCoreApp*)openAppAtLocation:(NSString*)location
  59. withIndexPath:(NSString*)indexPath
  60. withArgs:(NSString*__nullable)args
  61. withDelegate:(id<PDRCoreAppWindowDelegate>__nullable)delegate __attribute__((deprecated("deprecated, Use -openAppWithAppid:withArgs:withDelegate:")));
  62. - (void)registerAppHandle:(Class)universalAppImp withScheme:(NSString*)scheme;
  63. @end
  64. NS_ASSUME_NONNULL_END