基础组件库
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

AppDelegate.m 2.3 KiB

4 lat temu
4 lat temu
4 lat temu
4 lat temu
4 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #import "AppDelegate.h"
  2. #import "GeneratedPluginRegistrant.h"
  3. #import <zhiying_comm/ZhiyingCommNative.h>
  4. #import <AlibcTradeSDK/AlibcTradeSDK.h>
  5. @implementation AppDelegate
  6. - (BOOL)application:(UIApplication *)application
  7. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  8. [GeneratedPluginRegistrant registerWithRegistry:self];
  9. // Override point for customization after application launch.
  10. [ZhiyingCommNative regist: self];
  11. return [super application:application didFinishLaunchingWithOptions:launchOptions];
  12. }
  13. // 公共跳转方法
  14. - (void)openPage: (NSDictionary*)params {
  15. }
  16. - (void)openNativePage: (NSDictionary*)params {
  17. NSString *method = [params valueForKey:@"method"];
  18. if ([method isEqualToString: @""]) {
  19. }
  20. }
  21. // 获取设置
  22. - (NSDictionary*)getSetting {
  23. return @{
  24. @"domain": @"http://inapi.izhyin.cn",
  25. @"master_id": @"123456",
  26. @"secret_key": @"123456"
  27. //@"domain": @"http://192.168.0.113:5000"
  28. };
  29. // return @{
  30. // @"domain": @"http://api.zhios.cn",
  31. // @"master_id": @"99813608",
  32. // @"secret_key": @"123456"
  33. //@"domain": @"http://192.168.0.113:5000"
  34. // };
  35. }
  36. #pragma mark -- 第三方应用跳转
  37. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{
  38. // 如果百川处理过会返回YES
  39. if (![[AlibcTradeSDK sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) {
  40. return YES;
  41. }
  42. return [super application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
  43. }
  44. //IOS9.0 系统新的处理openURL 的API
  45. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
  46. if (@available(iOS 9.0, *)) {
  47. __unused BOOL isHandledByALBBSDK=[[AlibcTradeSDK sharedInstance] application:application openURL:url options:options];
  48. if (isHandledByALBBSDK)
  49. return isHandledByALBBSDK;
  50. } else {
  51. // Fallback on earlier versions
  52. }//处理其他app跳转到自己的app,如果百川处理过会返回YES
  53. return [super application:application openURL:url options:options];
  54. }
  55. @end