酷店

AlibcLinkPartnerBridge.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * AlibcLinkPartnerBridge.h
  3. *
  4. * 阿里百川电商
  5. * 项目名称:阿里巴巴电商 AlibcTradeBiz
  6. * 版本号:3.1.1.96
  7. * 发布时间:2017-03-24
  8. * 开发团队:阿里巴巴百川商业化团队
  9. * 阿里巴巴电商SDK答疑群号:1229144682(阿里旺旺)
  10. * Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #ifndef AlibcNativeFailMode_Enum
  14. #define AlibcNativeFailMode_Enum
  15. /**
  16. 拉起手淘失败后的处理策略
  17. - AlibcNativeFailModeJumpH5: 当拉起手淘/天猫失败, 则在 webview 中跳转对应 H5 页面; 默认选项
  18. - AlibcNativeFailModeJumpDownloadPage: 当拉起手淘/天猫失败, 则跳转对应 App 下载页面
  19. - AlibcNativeFailModeJumpBrowser: 当拉起手淘/天猫失败, 则在浏览器中跳转对应 H5 页面
  20. - AlibcNativeFailModeNone: 当拉起手淘/天猫失败, 不做额外操作
  21. */
  22. typedef NS_ENUM(NSInteger, AlibcNativeFailMode) {
  23. AlibcNativeFailModeJumpH5 = 0,
  24. AlibcNativeFailModeJumpDownloadPage = 1,
  25. AlibcNativeFailModeJumpBrowser = 2,
  26. AlibcNativeFailModeNone = 3,
  27. };
  28. #endif
  29. #ifndef ALiApplinkBridge_h
  30. #define ALiApplinkBridge_h
  31. NS_ASSUME_NONNULL_BEGIN
  32. @class AlibcError;
  33. @class AlibcTradeTaokeParams;
  34. @interface AlibcLinkPartnerBridge : NSObject
  35. /**
  36. * 初始化
  37. @param appkey appkey
  38. */
  39. + (void)initWithAppkey:(nonnull NSString *)appkey;
  40. /**
  41. * 尝试跳转详情页
  42. @param itemID Item ID
  43. @param params 参数
  44. @param failMode 跳转失败处理策略
  45. @param taoKeParams 淘客参数
  46. @return 跳转错误对象
  47. */
  48. + (nullable AlibcError *)tryJumpToDetail:(NSString *)itemID
  49. params:(nullable NSDictionary *)params
  50. failMode:(AlibcNativeFailMode)failMode
  51. taokeParams:(nullable AlibcTradeTaokeParams *)taoKeParams;
  52. /**
  53. * 尝试跳转店铺页
  54. @param shopID shopID
  55. @param params 参数
  56. @param failMode 跳转失败处理策略
  57. @param taoKeParams 淘客参数
  58. @return 跳转错误对象
  59. */
  60. + (nullable AlibcError *)tryJumpToShop:(NSString *)shopID
  61. params:(nullable NSDictionary *)params
  62. failMode:(AlibcNativeFailMode)failMode
  63. taokeParams:(nullable AlibcTradeTaokeParams *)taoKeParams;
  64. /**
  65. * 尝试跳转指定网页
  66. @param url URL String
  67. @param params 参数
  68. @param failMode 跳转失败处理策略
  69. @param taoKeParams 淘客参数
  70. @return 跳转错误对象
  71. */
  72. + (nullable AlibcError *)tryJumpToURL:(NSString *)url
  73. params:(nullable NSDictionary *)params
  74. failMode:(AlibcNativeFailMode)failMode
  75. taokeParams:(nullable AlibcTradeTaokeParams *)taoKeParams;
  76. /**
  77. * 处理 URL 跳转
  78. @param url url
  79. @param sourceApplication sourceApplication
  80. @param options options
  81. @return handle or not
  82. */
  83. + (BOOL)handleOpenURL:(NSURL *)url
  84. sourceApplication:(nullable NSString *)sourceApplication
  85. options:(nullable NSDictionary<NSString *, id> *)options;
  86. /**
  87. * 在天猫未安装导致天猫打开失败时, 尝试打开手淘
  88. @param enable enable
  89. */
  90. + (void)enableOpenTaobaoWhenTmallNotInstalled:(BOOL)enable;
  91. @end
  92. NS_ASSUME_NONNULL_END
  93. #endif //ALiApplinkBridge_h