KMProductModel.swift 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. //
  2. // KMProductModel.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/11/6.
  6. //
  7. import Foundation
  8. import Combine
  9. #if !VERSION_DMG
  10. import StoreKit
  11. #endif
  12. @objc enum KMCompareTableType : Int {
  13. case trial = 0 // 试用比较表
  14. case dmg_Base // DMG 购买比较表
  15. case dmg_Upgrades1 // DMG 升级比较表 39.99
  16. case dmg_Upgrades2 // DMG 升级比较表 49.99
  17. case lite_Base // Lite 基础版
  18. case lite_MacWindows // Lite Mac&Windows双平台高级版永久
  19. case pro_Base // Pro 基础版
  20. case pro_Advanced // Pro Mac单平台高级版永久
  21. }
  22. @objc enum KMCompareProductType : Int {
  23. case free = 0 // 免费
  24. case freeTrial // 试用
  25. case allPlatformStandard // 全平台标准版年订阅
  26. case dualPlatformAdvanced // Mac&Windows双平台高级版永久
  27. case allPlatformAdvanced_6 // 全平台高级版6个月订阅
  28. case allPlatformAdvanced_12 // 全平台高级版12个月订阅
  29. case macPlatformAdvanced // MAC单平台高级版永久
  30. }
  31. @objc enum KMPurchasedProductType : Int {
  32. case fourDevicesAllAccessPackNew6months_lite = 0 // 4_devices_all_access_pack_new_6months(订阅)
  33. case fourDevicesAllAccessPackNew12months_lite // 4_devices_all_access_pack_12months(订阅)
  34. // case allAccessPackNew6months_lite // all_access_pack_new_6months(订阅)
  35. // case allAccessPack12months_lite // all_access_pack_12months(订阅)
  36. // case allAccessPack6months_lite // all_access_pack_6months(订阅)
  37. case aiAllAccessPack1month_lite // ai_all_access_pack_1month(订阅)
  38. case aiAllAccessPack12month_lite // ai_all_access_pack_12month(订阅)
  39. case allAccessPackPermanent_lite // all_access_pack_permanent(永久)
  40. case advancedAddDevicesAllAccessPack12months_lite // advanced_add_devices_all_access_pack_12months(订阅)
  41. case advancedAdd2DevicesAllAccessPack12months_lite // advanced_add_2_devices_all_access_pack_12months(订阅)
  42. case aiAllAccessPack1month_pro // ai_all_access_pack_1month(订阅)
  43. case aiAllAccessPack12month_pro // ai_all_access_pack_1month(订阅)
  44. case pdfToOfficePackPermanent_pro // pdf_to_office_pack_permanent(永久)
  45. case fourDevicesAllAccessPack12months_pro // 4_devices_all_access_pack_12months(全平台高级年订阅)
  46. case standardAddDevicesAllAccessPack12months_pro // standard_add_devices_all_access_pack_12months(订阅)
  47. case advancedAddDevicesAllAccessPack12months_pro // advanced_add_devices_all_access_pack_12months(订阅)
  48. case advancedAdd2DevicesAllAccessPack12months_pro // advanced_add_2_devices_all_access_pack_12months(订阅)
  49. case pdfReaderProStandard_dmg // 全平台标准版年订阅
  50. case pdfReaderProAdvanced_dmg // 全平台高级版年订阅
  51. case pdfReaderProPermanent_dmg // Mac&Windows双平台高级版永久
  52. case pdfReaderProAIAnnual_dmg // AI 年订阅
  53. case pdfReaderProAIMonthly_dmg // AI 月订阅
  54. case pdfToOffice_dmg // 转档包 永久
  55. case add2Device_dmg // 多设备全平台
  56. case add3Device_dmg // 单平台升级高级版
  57. }
  58. typealias AppstorePurchaseComplete = (_ success: Bool,_ msg: String) -> Void
  59. @objcMembers
  60. class KMProductModel: ObservableObject {
  61. static let shared = KMProductModel()
  62. /**
  63. 比较表类型
  64. */
  65. @Published var state: KMCompareTableType = .trial
  66. /**
  67. 高级版半年 或 年订阅,true为年订阅,false为半年订阅,默认true为年订阅
  68. */
  69. @Published var isPurchaseSwitch: Bool = true
  70. // MARK: DMG Public Property
  71. /**
  72. DMG 版本所有已经上架产品记录(暂时无教育优惠)
  73. */
  74. var dmgProductDatas: KMMemberProductResult?
  75. /**
  76. DMG 版本 已经登录用户 最后一次价格获取
  77. */
  78. var dmgLastGetProductPriceInfos: KMMemberProductResult?
  79. /**
  80. DMG 版本 已经登录用户 最后一次批量价格获取
  81. */
  82. var dmgLastGetBatchProductPriceInfos: KMMemberProductResult?
  83. /**
  84. DMG 版本 已经登录用户 最后一次验证商品优惠券价格获取
  85. */
  86. var dmgLastCheckCouponProductPriceInfos: KMMemberProductResult?
  87. /**
  88. DMG 版本 已经登录用户 最后一次创建的买断订单返回信息
  89. */
  90. var dmgLastCreatOrderProductInfos: KMMemberProductResult?
  91. /**
  92. DMG 版本 已经登录用户 最后一次创建的买断订单返回信息
  93. */
  94. var dmgLastCreatSubscriberProductInfos: KMMemberProductResult?
  95. // MARK: DMG Public Method
  96. func checkConnectionAvailable() -> Void {
  97. if KMMemberCenterManager.manager.isConnectionAvailable() == false {
  98. let alert = NSAlert()
  99. alert.alertStyle = .critical
  100. alert.messageText = NSLocalizedString("Error Information", comment: "")
  101. alert.informativeText = NSLocalizedString("Please make sure your internet connection is available.", comment: "")
  102. alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
  103. alert.runModal()
  104. return
  105. }
  106. }
  107. /**
  108. @abstract 获取DMG服务器架上所有商品 (得到的价格是原始价格)
  109. @param
  110. */
  111. func getDMGProductDatas( _ complete: @escaping KMMemberProductComplete) -> Void {
  112. checkConnectionAvailable()
  113. KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
  114. guard let productsArrays : KMMemberProductResult = result else { return }
  115. self?.dmgProductDatas = productsArrays
  116. complete(success, result)
  117. }
  118. if KMMemberInfo.shared.isLogin {
  119. // getDMGProductPriceInfosForMember(productId: "SP2024102300004", isEducation: 0) { [weak self] success, result in
  120. //
  121. //
  122. // }
  123. // getDMGBatchProductPriceInfosForMember(productId: "SP2024102300004", num: 10) { [weak self] success, result in
  124. //
  125. //
  126. // }
  127. // getDMGProductListInfosForMember(orderStatus: 0) { [weak self] success, result in
  128. //
  129. // }
  130. //创建买断订单
  131. // creatOrder(productId: "SP2024102300004", paymentMethod: 0, price: "119.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
  132. //
  133. // }
  134. //创建订阅订单(创建买断订单后会报错已经是购买用户,不能重复购买)
  135. // createSubscriber(productId: "SP2024102300003", paymentMethod: 0, price: "99.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
  136. //
  137. // }
  138. // getDMGProductOrderIdInfosForMember(orderId: "94b10d5f1ca193948e005503bff0df11") { [weak self] success, result in
  139. //
  140. // }
  141. }
  142. }
  143. /**
  144. @abstract 获取DMG产品价格(美元)
  145. */
  146. func getDMGPrice(productCode: String) -> String {
  147. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  148. for model in productModels {
  149. if model.code == "productCode" {
  150. return model.price.stringValue
  151. }
  152. }
  153. return ""
  154. }
  155. /**
  156. @abstract 获取DMG产品价格(人民币)
  157. */
  158. func getDMGCNYPrice(productCode: String) -> String {
  159. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  160. for model in productModels {
  161. if model.code == "productCode" {
  162. return model.cnyPrice.stringValue
  163. }
  164. }
  165. return ""
  166. }
  167. /**
  168. @abstract 获取DMG产品折扣价格(美元)
  169. */
  170. func getDMGDisplayPrice(productCode: String) -> String {
  171. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  172. for model in productModels {
  173. if model.code == "productCode" {
  174. return model.displayPrice.stringValue
  175. }
  176. }
  177. return ""
  178. }
  179. /**
  180. @abstract 获取DMG产品折扣价格(人民币)
  181. */
  182. func getDMGDisplayCNYPrice(productCode: String) -> String {
  183. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  184. for model in productModels {
  185. if model.code == "productCode" {
  186. return model.displayCnyPrice.stringValue
  187. }
  188. }
  189. return ""
  190. }
  191. /**
  192. @abstract 获取登录用户价格(建立订单时需要用到)
  193. @param productId 购买的产品id
  194. @param isEducation 是否教育优惠
  195. @param complete 回调
  196. */
  197. func getDMGProductPriceInfosForMember(productId: String, isEducation: Int, _ complete: @escaping KMMemberProductComplete) {
  198. checkConnectionAvailable()
  199. //暂时无教育优惠,先固定传 0
  200. KMMemberCenterManager.manager.getProductPriceForBuy(productId: productId, isEducation: 0, userId:KMMemberInfo.shared.userID) { [weak self] success, result in
  201. if success {
  202. guard let productsArrays : KMMemberProductResult = result else {
  203. complete(false, result)
  204. return
  205. }
  206. self?.dmgLastGetProductPriceInfos = productsArrays
  207. complete(true, productsArrays)
  208. } else {
  209. complete(false, result)
  210. }
  211. }
  212. }
  213. /**
  214. @abstract 获取批量阶段购买价格(建立订单时需要用到)
  215. @param productId 购买的产品id
  216. @param num 批量个数
  217. @param complete 回调
  218. */
  219. func getDMGBatchProductPriceInfosForMember(productId: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  220. checkConnectionAvailable()
  221. KMMemberCenterManager.manager.getBatchProductPrice(productId: productId, num: num) { [weak self] success, result in
  222. if success {
  223. guard let productsArrays : KMMemberProductResult = result else {
  224. complete(false, result)
  225. return
  226. }
  227. self?.dmgLastGetBatchProductPriceInfos = productsArrays
  228. complete(true, productsArrays)
  229. } else {
  230. complete(false, result)
  231. }
  232. }
  233. }
  234. /**
  235. @abstract 验证商品优惠券(建立订单时需要用到)
  236. @param productId 购买的产品id
  237. @param code 优惠券
  238. @param complete 回调
  239. */
  240. func getDMGCheckCouponProductPriceInfosForMember(productId: String, code: String, _ complete: @escaping KMMemberProductComplete) {
  241. checkConnectionAvailable()
  242. KMMemberCenterManager.manager.checkCoupon(productId: productId, userId: KMMemberInfo.shared.userID, code: code) { [weak self] success, result in
  243. if success {
  244. guard let productsArrays : KMMemberProductResult = result else {
  245. complete(false, result)
  246. return
  247. }
  248. self?.dmgLastCheckCouponProductPriceInfos = productsArrays
  249. complete(true, productsArrays)
  250. } else {
  251. complete(false, result)
  252. }
  253. }
  254. }
  255. /**
  256. @abstract 获取订单列表
  257. @param orderStatus 0全部1待支付
  258. @param complete 回调
  259. */
  260. func getDMGProductListInfosForMember(orderStatus: Int, _ complete: @escaping KMMemberRequestInfoComplete) {
  261. checkConnectionAvailable()
  262. KMMemberCenterManager.manager.getOrderListByStatus(orderStatus: orderStatus) { [weak self] success, result in
  263. if success {
  264. guard let productsInfos : NSDictionary = result else {
  265. complete(false, result)
  266. return
  267. }
  268. complete(true, productsInfos)
  269. } else {
  270. complete(false, result)
  271. }
  272. }
  273. }
  274. /**
  275. @abstract 创建订单(买断)
  276. @param productId 产品id
  277. @param paymentMethod 支付方式 PAYPAL(0),ALIPAY(1),WXPAY(2),PADDLE(3)
  278. @param price 价格
  279. @param discountFlag 0原价,1优惠券,2升级,3教育优惠,4批量购买,5黑五折扣
  280. @param couponCode 优惠卷
  281. @param num 批量购买数量
  282. @param complete 回调
  283. */
  284. func creatOrder(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  285. checkConnectionAvailable()
  286. KMMemberCenterManager.manager.createOrder(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
  287. if success {
  288. guard let productsArrays : KMMemberProductResult = result else {
  289. complete(false, result)
  290. return
  291. }
  292. self?.dmgLastCreatOrderProductInfos = productsArrays
  293. complete(true, productsArrays)
  294. } else {
  295. complete(false, result)
  296. }
  297. }
  298. }
  299. /**
  300. @abstract 创建订单(订阅)
  301. @param productId 产品id
  302. @param paymentMethod 支付方式 PAYPAL(0),ALIPAY(1),WXPAY(2),PADDLE(3)
  303. @param price 价格
  304. @param discountFlag 0原价,1优惠券,2升级,3教育优惠,4批量购买,5黑五折扣
  305. @param couponCode 优惠卷
  306. @param num 批量购买数量
  307. @param complete 回调
  308. */
  309. func createSubscriber(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  310. checkConnectionAvailable()
  311. KMMemberCenterManager.manager.createSubscriber(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
  312. if success {
  313. guard let productsArrays : KMMemberProductResult = result else {
  314. complete(false, result)
  315. return
  316. }
  317. self?.dmgLastCreatSubscriberProductInfos = productsArrays
  318. complete(true, productsArrays)
  319. } else {
  320. complete(false, result)
  321. }
  322. }
  323. }
  324. /**
  325. @abstract 支付后查询订单状态
  326. @param productId 购买的产品id
  327. @param complete 回调
  328. */
  329. func getDMGProductOrderIdInfosForMember(orderId: String, _ complete: @escaping KMMemberRequestInfoComplete) {
  330. checkConnectionAvailable()
  331. KMMemberCenterManager.manager.getStateByOrderId(orderId: orderId) { [weak self] success, result in
  332. if success {
  333. guard let productsInfos : NSDictionary = result else {
  334. complete(false, result)
  335. return
  336. }
  337. complete(true, productsInfos)
  338. } else {
  339. complete(false, result)
  340. }
  341. }
  342. }
  343. // MARK: Public Method
  344. /**
  345. @abstract 根据当前权益获取比较表类型
  346. @param
  347. */
  348. func getCurrentComparisonTableType() -> Void {
  349. let userScenarioType = KMMemberInfo.shared.userScenarioType
  350. let platforms = KMMemberInfo.shared.vip_platforms
  351. let platformsArray = platforms
  352. .components(separatedBy: ",")
  353. .map { $0.trimmingCharacters(in: .whitespaces) }
  354. if userScenarioType == .lite_type1 ||
  355. userScenarioType == .lite_type3 ||
  356. userScenarioType == .lite_type11 ||
  357. userScenarioType == .lite_type4 ||
  358. userScenarioType == .lite_type5 ||
  359. userScenarioType == .lite_type9 ||
  360. userScenarioType == .lite_type13 ||
  361. userScenarioType == .lite_type7 ||
  362. userScenarioType == .lite_type8 {
  363. if userScenarioType == .lite_type1 {
  364. state = .trial
  365. } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type11 {
  366. state = .lite_Base
  367. } else if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type9 || userScenarioType == .lite_type13 {
  368. state = .lite_MacWindows
  369. } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
  370. if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
  371. state = .lite_MacWindows
  372. } else {
  373. state = .lite_Base
  374. }
  375. }
  376. } else if userScenarioType == .pro_type1 ||
  377. userScenarioType == .pro_type3 ||
  378. userScenarioType == .pro_type4 {
  379. if userScenarioType == .pro_type1 ||
  380. userScenarioType == .pro_type4 {
  381. state = .pro_Advanced
  382. } else if userScenarioType == .pro_type3 {
  383. state = .pro_Base
  384. }
  385. }
  386. }
  387. /**
  388. 对应商品价格
  389. */
  390. func getProductPrice(_ type: KMPurchasedProductType) -> String {
  391. if type == .fourDevicesAllAccessPackNew6months_lite {
  392. if let product = IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, product.isOffers {
  393. return product.offersPrice()
  394. } else {
  395. return IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.price()
  396. }
  397. } else if type == .fourDevicesAllAccessPackNew12months_lite {
  398. if let product = IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, product.isOffers {
  399. return product.offersPrice()
  400. } else {
  401. return IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.price()
  402. }
  403. } else if type == .aiAllAccessPack1month_lite {
  404. if let product = IAPProductsManager.default().aiAllAccessPack1month_lite, product.isOffers {
  405. return product.offersPrice()
  406. } else {
  407. return IAPProductsManager.default().aiAllAccessPack1month_lite.price()
  408. }
  409. } else if type == .aiAllAccessPack12month_lite {
  410. if let product = IAPProductsManager.default().aiAllAccessPack12month_lite, product.isOffers {
  411. return product.offersPrice()
  412. } else {
  413. return IAPProductsManager.default().aiAllAccessPack12month_lite.price()
  414. }
  415. } else if type == .allAccessPackPermanent_lite {
  416. if let product = IAPProductsManager.default().allAccessPackPermanent_lite, product.isOffers {
  417. return product.offersPrice()
  418. } else {
  419. return IAPProductsManager.default().allAccessPackPermanent_lite.price()
  420. }
  421. } else if type == .advancedAddDevicesAllAccessPack12months_lite {
  422. if let product = IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite, product.isOffers {
  423. return product.offersPrice()
  424. } else {
  425. return IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite.price()
  426. }
  427. } else if type == .advancedAdd2DevicesAllAccessPack12months_lite {
  428. if let product = IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite, product.isOffers {
  429. return product.offersPrice()
  430. } else {
  431. return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.price()
  432. }
  433. } else if type == .aiAllAccessPack1month_pro {
  434. if let product = IAPProductsManager.default().aiAllAccessPack1month_pro, product.isOffers {
  435. return product.offersPrice()
  436. } else {
  437. return IAPProductsManager.default().aiAllAccessPack1month_pro.price()
  438. }
  439. } else if type == .aiAllAccessPack12month_pro {
  440. if let product = IAPProductsManager.default().aiAllAccessPack12month_pro, product.isOffers {
  441. return product.offersPrice()
  442. } else {
  443. return IAPProductsManager.default().aiAllAccessPack12month_pro.price()
  444. }
  445. } else if type == .pdfToOfficePackPermanent_pro {
  446. if let product = IAPProductsManager.default().pdfToOfficePackPermanent_pro, product.isOffers {
  447. return product.offersPrice()
  448. } else {
  449. return IAPProductsManager.default().pdfToOfficePackPermanent_pro.price()
  450. }
  451. } else if type == .fourDevicesAllAccessPack12months_pro {
  452. if let product = IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, product.isOffers {
  453. return product.offersPrice()
  454. } else {
  455. return IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.price()
  456. }
  457. } else if type == .standardAddDevicesAllAccessPack12months_pro {
  458. if let product = IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, product.isOffers {
  459. return product.offersPrice()
  460. } else {
  461. return IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro.price()
  462. }
  463. } else if type == .advancedAddDevicesAllAccessPack12months_pro {
  464. if let product = IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, product.isOffers {
  465. return product.offersPrice()
  466. } else {
  467. return IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro.price()
  468. }
  469. } else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
  470. if let product = IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, product.isOffers {
  471. return product.offersPrice()
  472. } else {
  473. return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro.price()
  474. }
  475. } else if type == .pdfReaderProStandard_dmg {
  476. return getDMGPrice(productCode: "PDF Reader Pro Standard - Annual Plan")
  477. } else if type == .pdfReaderProAdvanced_dmg {
  478. return getDMGPrice(productCode: "PDF Reader Pro Advanced - Annual Plan")
  479. } else if type == .pdfReaderProPermanent_dmg {
  480. return getDMGPrice(productCode: "PDF Reader Pro Permanent")
  481. } else if type == .pdfReaderProAIAnnual_dmg {
  482. return getDMGPrice(productCode: "PDF Reader Pro AI - Annual Plan")
  483. } else if type == .pdfReaderProAIMonthly_dmg {
  484. return getDMGPrice(productCode: "PDF Reader Pro AI - Monthly Plan")
  485. } else if type == .pdfToOffice_dmg {
  486. return getDMGPrice(productCode: "PDF to Office")
  487. } else if type == .add2Device_dmg {
  488. return getDMGPrice(productCode: "Add 2-Device · Advanced Annual")
  489. } else if type == .add3Device_dmg {
  490. return getDMGPrice(productCode: "Add 3-Device · Advanced Annual")
  491. }
  492. return ""
  493. }
  494. func appstorePurchaseAction(_ tag: Int, _ complete: @escaping AppstorePurchaseComplete) -> Void {
  495. if state == .dmg_Base {
  496. var code = ""
  497. if tag == 1 {
  498. code = "PDF Reader Pro Standard - Annual Plan"
  499. } else if tag == 3 {
  500. code = "PDF Reader Pro Permanent"
  501. } else {
  502. code = "PDF Reader Pro Advanced - Annual Plan"
  503. }
  504. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(code)
  505. embeddedWC.showWindow(nil)
  506. embeddedWC.window?.center()
  507. } else if state == .dmg_Upgrades1 {
  508. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 2-Device · Advanced Annual")
  509. embeddedWC.showWindow(nil)
  510. embeddedWC.window?.center()
  511. } else if state == .dmg_Upgrades2 {
  512. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 3-Device · Advanced Annual")
  513. embeddedWC.showWindow(nil)
  514. embeddedWC.window?.center()
  515. } else if state == .lite_Base {
  516. if tag == 0 {
  517. if isPurchaseSwitch { membershipPurchase(.fourDevicesAllAccessPackNew12months_lite) }
  518. else { membershipPurchase(.fourDevicesAllAccessPackNew6months_lite) }
  519. } else if tag == 3 {
  520. membershipPurchase(.allAccessPackPermanent_lite)
  521. } else {
  522. membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
  523. }
  524. } else if state == .lite_MacWindows {
  525. if tag == 2 {
  526. let platforms = KMMemberInfo.shared.vip_platforms
  527. let platformsArray = platforms
  528. .components(separatedBy: ",")
  529. .map { $0.trimmingCharacters(in: .whitespaces) }
  530. if KMMemberInfo.shared.userScenarioType == .lite_type5 {
  531. if platformsArray.count == 1 {
  532. membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
  533. } else if platformsArray.count == 2 {
  534. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  535. }
  536. } else {
  537. if platformsArray.count == 1 {
  538. membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
  539. } else if platformsArray.count == 2 {
  540. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  541. } else {
  542. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  543. }
  544. }
  545. }
  546. } else if state == .pro_Base {
  547. if KMMemberInfo.shared.userScenarioType == .pro_type3 {
  548. if tag == 2 {
  549. membershipPurchase(.standardAddDevicesAllAccessPack12months_pro)
  550. } else if tag == 3 {
  551. membershipPurchase(.pdfToOfficePackPermanent_pro)
  552. }
  553. }
  554. } else if state == .pro_Advanced {
  555. if KMMemberInfo.shared.userScenarioType == .pro_type1 {
  556. membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
  557. } else if KMMemberInfo.shared.userScenarioType == .pro_type4 {
  558. let platforms = KMMemberInfo.shared.vip_platforms
  559. let platformsArray = platforms
  560. .components(separatedBy: ",")
  561. .map { $0.trimmingCharacters(in: .whitespaces) }
  562. if platformsArray.count == 1 {
  563. membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
  564. } else if platformsArray.count == 2 {
  565. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
  566. } else {
  567. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
  568. }
  569. }
  570. } else {
  571. if tag == 2 {
  572. membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
  573. }
  574. }
  575. }
  576. func appStoreEquityVerification(_ notification: Notification,_ complete: @escaping KMMemberProductComplete) -> Void {
  577. #if VERSION_FREE
  578. #if VERSION_DMG
  579. // DMG
  580. #else
  581. // AppStore 免费版本
  582. if let userInfo = notification.object as? SKPaymentTransaction,
  583. let transactionId = userInfo.transactionIdentifier as? String,
  584. let productId = userInfo.payment.productIdentifier as? String {
  585. print("Transaction ID: \(transactionId)")
  586. print("product ID: \(productId)")
  587. var productCode = ""
  588. var isSubscribed = false
  589. if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001" {
  590. productCode = "advanced-annual-subscription-six-month"
  591. if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
  592. isSubscribed = true
  593. }
  594. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_annual.001" {
  595. productCode = "advanced-annual-subscription"
  596. if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isSubscribed {
  597. isSubscribed = true
  598. }
  599. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001" {
  600. productCode = "advanced-annual-subscription-six-month"
  601. if IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed {
  602. isSubscribed = true
  603. }
  604. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_12months.001" {
  605. productCode = "advanced-annual-subscription"
  606. if IAPProductsManager.default().allAccessPack12months_lite.isSubscribed {
  607. isSubscribed = true
  608. }
  609. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_6months.001" {
  610. productCode = "advanced-annual-subscription-six-month"
  611. if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed {
  612. isSubscribed = true
  613. }
  614. } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_1_month" {
  615. productCode = "ai-subscription-month"
  616. if IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed {
  617. isSubscribed = true
  618. }
  619. } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_12_month" {
  620. productCode = "ai-subscription-year-trail"
  621. if IAPProductsManager.default().aiAllAccessPack12month_lite.isSubscribed {
  622. isSubscribed = true
  623. }
  624. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_permanent_license.001" {
  625. productCode = "advanced-permanent"
  626. if IAPProductsManager.default().allAccessPackPermanent_lite.isSubscribed {
  627. isSubscribed = true
  628. }
  629. } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_devices_all_access_pack_advanced_annual.001" {
  630. productCode = "advanced-annual-subscription-single-upgrade"
  631. if IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite.isSubscribed {
  632. isSubscribed = true
  633. }
  634. } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_2_devices_all_access_pack_advanced_annual.001" {
  635. productCode = "advanced-annual-subscription-multi-upgrade"
  636. if IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed {
  637. isSubscribed = true
  638. }
  639. }
  640. if isSubscribed {
  641. KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
  642. if success {
  643. complete(true, result)
  644. } else {
  645. complete(false, result)
  646. }
  647. }
  648. }
  649. } else {
  650. print("Transaction ID not found in notification.")
  651. }
  652. #endif
  653. #else
  654. // AppStore 付费版
  655. if let userInfo = notification.object as? SKPaymentTransaction,
  656. let transactionId = userInfo.transactionIdentifier as? String,
  657. let productId = userInfo.payment.productIdentifier as? String {
  658. print("Transaction ID: \(transactionId)")
  659. print("product ID: \(productId)")
  660. var productCode = ""
  661. var isSubscribed = false
  662. if productId == "com.pdfreaderpro.mac.ai_pack_1_month" {
  663. productCode = "ai-subscription-month"
  664. if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
  665. isSubscribed = true
  666. }
  667. } else if productId == "com.pdfreaderpro.mac.ai_pack_12_month" {
  668. productCode = "ai-subscription-year-trail"
  669. if IAPProductsManager.default().aiAllAccessPack12month_pro.isSubscribed {
  670. isSubscribed = true
  671. }
  672. } else if productId == "com.pdfreaderpro.mac.pdf_to_office_pack_permanent_license.001" {
  673. productCode = "advanced-permanent-mac-upgrade"
  674. if IAPProductsManager.default().pdfToOfficePackPermanent_pro.isSubscribed {
  675. isSubscribed = true
  676. }
  677. } else if productId == "com.pdfreaderpro.mac.all_access_pack_advanced_annual.001" {
  678. productCode = "advanced-permanent-mac-upgrade"
  679. if IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.isSubscribed {
  680. isSubscribed = true
  681. }
  682. }
  683. if isSubscribed {
  684. KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
  685. if success {
  686. complete(true, result)
  687. } else {
  688. complete(false, result)
  689. }
  690. }
  691. }
  692. } else {
  693. print("Transaction ID not found in notification.")
  694. }
  695. #endif
  696. }
  697. var isCancelAutoRenew: Bool {
  698. return IAPProductsManager.default().isCancelAutoRenew()
  699. }
  700. var isShowSale: Bool {
  701. if #available(macOS 10.14.4, *), isCancelAutoRenew {
  702. let manager = IAPProductsManager.default()
  703. let isSubscribed_newlyMonth = manager?.allAccessPackNew6months_lite.isSubscribed ?? false
  704. let isSubscribed_year = manager?.allAccessPack12months_lite.isSubscribed ?? false
  705. if isSubscribed_newlyMonth || isSubscribed_year {
  706. return false
  707. }
  708. if let info = KMAdvertisementManager.manager.info.StoreUserRecovery?.content?.first, !(info.show! as NSString).boolValue {
  709. return false
  710. }
  711. return true
  712. }
  713. return false
  714. }
  715. // MARK: Private Method
  716. /**
  717. 会员购买
  718. */
  719. private func membershipPurchase(_ type: KMPurchasedProductType) -> Void {
  720. if type == .fourDevicesAllAccessPackNew6months_lite || type == .fourDevicesAllAccessPackNew12months_lite {
  721. if isPurchaseSwitch {
  722. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, discount: isCancelAutoRenew)
  723. } else {
  724. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, discount: isCancelAutoRenew)
  725. }
  726. } else if type == .aiAllAccessPack1month_lite {
  727. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack1month_lite, discount: isCancelAutoRenew)
  728. } else if type == .aiAllAccessPack12month_lite {
  729. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: isCancelAutoRenew)
  730. } else if type == .allAccessPackPermanent_lite {
  731. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().allAccessPackPermanent_lite, discount: isCancelAutoRenew)
  732. } else if type == .advancedAddDevicesAllAccessPack12months_lite {
  733. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite, discount: isCancelAutoRenew)
  734. } else if type == .advancedAdd2DevicesAllAccessPack12months_lite {
  735. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite, discount: isCancelAutoRenew)
  736. } else if type == .aiAllAccessPack1month_pro {
  737. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack1month_pro, discount: isCancelAutoRenew)
  738. } else if type == .aiAllAccessPack12month_pro {
  739. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: isCancelAutoRenew)
  740. } else if type == .pdfToOfficePackPermanent_pro {
  741. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().pdfToOfficePackPermanent_pro, discount: isCancelAutoRenew)
  742. } else if type == .fourDevicesAllAccessPack12months_pro {
  743. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  744. } else if type == .standardAddDevicesAllAccessPack12months_pro {
  745. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  746. } else if type == .advancedAddDevicesAllAccessPack12months_pro {
  747. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  748. } else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
  749. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  750. }
  751. }
  752. // MARK: Action Method
  753. /**
  754. 恢复购买
  755. */
  756. func productRestore() -> Void {
  757. IAPProductsManager.default().restoreSubscriptions()
  758. }
  759. func privacyPolicyAction() -> Void {
  760. NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/privacy-policy")!)
  761. }
  762. func termOfSerAction() -> Void {
  763. NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/terms_of_service")!)
  764. }
  765. // MARK: Get & Set
  766. /**
  767. 当前比较表产品列表内容
  768. */
  769. var products: [KMCompareProductType] {
  770. if state == .trial {
  771. return [.free, .freeTrial]
  772. } else if state == .dmg_Base {
  773. return [.free, .allPlatformStandard, .allPlatformAdvanced_12, .dualPlatformAdvanced]
  774. } else if state == .dmg_Upgrades1 {
  775. return [.allPlatformAdvanced_12]
  776. } else if state == .dmg_Upgrades1 {
  777. return [.allPlatformAdvanced_12]
  778. } else if state == .lite_Base {
  779. return [.free, .allPlatformAdvanced_6, .allPlatformAdvanced_12, .dualPlatformAdvanced]
  780. } else if state == .lite_MacWindows {
  781. return [.allPlatformAdvanced_12]
  782. } else if state == .pro_Base {
  783. return [.allPlatformAdvanced_12, .macPlatformAdvanced]
  784. } else if state == .pro_Advanced {
  785. return [.allPlatformAdvanced_12]
  786. }
  787. return []
  788. }
  789. /**
  790. 比较表数据源
  791. */
  792. var dataSource: [Any] {
  793. if isPurchaseSwitch {
  794. // 试用 全平台标准版年订阅 全平台高级版6/12个月订阅 Mac&Windows双平台高级版永久 MAC单平台高级版永久
  795. //MAC单平台标准版永久
  796. return [
  797. "Benefit",
  798. ["Supported platforms", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows", "mac"],
  799. ["Maximum number of accessible devices", "2 devices", "4 devices", "4 devices", "2 devices", "1 devices"],
  800. "PDF to Office",
  801. ["Convert PDFs to Word, HTML, TXT, JPEG or PNG files", "Only first 10 pages", "Standard", "Advanced", "Advanced", "Advanced"],
  802. ["Turn PDF to PPT, Excel, RTF, CSV, and more", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  803. ["Convert PDF to TIFF, BMP, GIF or TGA files", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  804. "Edit PDF",
  805. ["Add and edit text in PDF", "X", "✓", "✓", "✓", "✓"],
  806. ["Edit, crop, replace image in PDF", "X", "✓", "✓", "✓", "✓"],
  807. "OCR",
  808. ["Extract texts from image-based or scanned PDF", "X", "✓", "✓", "✓", "✓"],
  809. "Organize Pages",
  810. ["Extract, rotate, rearrange, replace, add, delete pages", "X", "✓", "✓", "✓", "✓"],
  811. ["Split PDFs into multiple files", "X", "✓", "✓", "✓", "✓"],
  812. "Advanced Editing Tools",
  813. ["Merge multiple documents into a new PDF", "Up to 2 files or 20 MB", "✓", "✓", "✓", "∞", "∞"],
  814. ["Add & edit watermark", "X", "✓", "✓", "✓", "✓"],
  815. ["Add header, footer, page numbers", "X", "✓", "✓", "✓", "✓"],
  816. ["Add Bates Number", "X", "✓", "✓", "✓", "✓"],
  817. ["Insert PDF page background by color or image", "X", "✓", "✓", "✓", "✓"],
  818. ["Create fattened copies", "X", "✓", "✓", "✓", "✓"],
  819. ["Extract Images", "X", "✓", "✓", "✓", "✓"],
  820. ["Extract tables", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  821. ["Measuring Tools", "X", "✓", "✓", "✓", "✓"],
  822. "Fill & Sign",
  823. ["Create digital signature", "X", "✓", "✓", "✓", "✓"],
  824. ["Create & Edit & Fill Adobe Fillable PDF Forms", "X", "✓", "✓", "✓", "✓"],
  825. "Security",
  826. ["Batch encrypting PDF documents", "X", "✓", "✓", "✓", "✓"],
  827. ["PDF Password Remover", "X", "✓", "✓", "✓", "✓"],
  828. ["Redact sensitive information", "X", "✓", "✓", "✓", "✓"],
  829. "Create PDF",
  830. ["Convert JPEG, JPG, PNG, TIFF, BMP or PSD files to PDFs", "1 file", "✓", "✓", "✓", "✓"],
  831. ["Create PDFs from a scanner and iOS devices", "X", "✓", "✓", "✓", "✓"],
  832. "Annotations",
  833. ["Customize PDF stamps", "X", "✓", "✓", "✓", "✓"],
  834. ["Hyperlink", "Page Number", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email"],
  835. ["Signature", "Standard", "Advanced", "Advanced", "Advanced", "Advanced"],
  836. ["Table", "X", "✓", "✓", "✓", "✓"],
  837. "View PDF",
  838. ["Multi-tab viewer", "X", "✓", "✓", "✓", "✓"],
  839. ["Various printing types: poster, booklet, multi-page printing", "X", "✓", "✓", "✓", "✓"],
  840. ["Customize theme colors: Light Mode, Dark Mode, Sepia Mode and more", "X", "✓", "✓", "✓", "✓"],
  841. ["Split View to compare files", "X", "✓", "✓", "✓", "✓"],
  842. "Subscription Based Solution",
  843. ["Access all premium features in app", "X", "12 months", "12 months", "∞", "∞"],
  844. ["Priority customer support", "X", "✓", "✓", "✓", "✓"],
  845. ["Ad-free", "X", "✓", "✓", "✓", "✓"]
  846. ]
  847. } else {
  848. return [
  849. "Benefit",
  850. ["Supported platforms", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows", "mac"],
  851. ["Maximum number of accessible devices", "2 devices", "4 devices", "4 devices", "2 devices", "1 devices"],
  852. "PDF to Office",
  853. ["Convert PDFs to Word, HTML, TXT, JPEG or PNG files", "Only first 10 pages", "Standard", "Advanced", "Advanced", "Advanced"],
  854. ["Turn PDF to PPT, Excel, RTF, CSV, and more", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  855. ["Convert PDF to TIFF, BMP, GIF or TGA files", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  856. "Edit PDF",
  857. ["Add and edit text in PDF", "X", "✓", "✓", "✓", "✓"],
  858. ["Edit, crop, replace image in PDF", "X", "✓", "✓", "✓", "✓"],
  859. "OCR",
  860. ["Extract texts from image-based or scanned PDF", "X", "✓", "✓", "✓", "✓"],
  861. "Organize Pages",
  862. ["Extract, rotate, rearrange, replace, add, delete pages", "X", "✓", "✓", "✓", "✓"],
  863. ["Split PDFs into multiple files", "X", "✓", "✓", "✓", "✓"],
  864. "Advanced Editing Tools",
  865. ["Merge multiple documents into a new PDF", "Up to 2 files or 20 MB", "✓", "✓", "✓", "∞", "∞"],
  866. ["Add & edit watermark", "X", "✓", "✓", "✓", "✓"],
  867. ["Add header, footer, page numbers", "X", "✓", "✓", "✓", "✓"],
  868. ["Add Bates Number", "X", "✓", "✓", "✓", "✓"],
  869. ["Insert PDF page background by color or image", "X", "✓", "✓", "✓", "✓"],
  870. ["Create fattened copies", "X", "✓", "✓", "✓", "✓"],
  871. ["Extract Images", "X", "✓", "✓", "✓", "✓"],
  872. ["Extract tables", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  873. ["Measuring Tools", "X", "✓", "✓", "✓", "✓"],
  874. "Fill & Sign",
  875. ["Create digital signature", "X", "✓", "✓", "✓", "✓"],
  876. ["Create & Edit & Fill Adobe Fillable PDF Forms", "X", "✓", "✓", "✓", "✓"],
  877. "Security",
  878. ["Batch encrypting PDF documents", "X", "✓", "✓", "✓", "✓"],
  879. ["PDF Password Remover", "X", "✓", "✓", "✓", "✓"],
  880. ["Redact sensitive information", "X", "✓", "✓", "✓", "✓"],
  881. "Create PDF",
  882. ["Convert JPEG, JPG, PNG, TIFF, BMP or PSD files to PDFs", "1 file", "✓", "✓", "✓", "✓"],
  883. ["Create PDFs from a scanner and iOS devices", "X", "✓", "✓", "✓", "✓"],
  884. "Annotations",
  885. ["Customize PDF stamps", "X", "✓", "✓", "✓", "✓"],
  886. ["Hyperlink", "Page Number", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email"],
  887. ["Signature", "Standard", "Advanced", "Advanced", "Advanced", "Advanced"],
  888. ["Table", "X", "✓", "✓", "✓", "✓"],
  889. "View PDF",
  890. ["Multi-tab viewer", "X", "✓", "✓", "✓", "✓"],
  891. ["Various printing types: poster, booklet, multi-page printing", "X", "✓", "✓", "✓", "✓"],
  892. ["Customize theme colors: Light Mode, Dark Mode, Sepia Mode and more", "X", "✓", "✓", "✓", "✓"],
  893. ["Split View to compare files", "X", "✓", "✓", "✓", "✓"],
  894. "Subscription Based Solution",
  895. ["Access all premium features in app", "X", "6 months", "6 months", "∞", "∞"],
  896. ["Priority customer support", "X", "✓", "✓", "✓", "✓"],
  897. ["Ad-free", "X", "✓", "✓", "✓", "✓"]
  898. ]
  899. }
  900. }
  901. }