Merge branch 'master' of https://git.warp.ly/open-source/warply_sdk_framework
Showing
12 changed files
with
145 additions
and
123 deletions
| ... | @@ -282,6 +282,14 @@ WL_VERSION_INTERFACE() | ... | @@ -282,6 +282,14 @@ WL_VERSION_INTERFACE() |
| 282 | @discussion This method gets the inbox with campaigns from Warply service. The | 282 | @discussion This method gets the inbox with campaigns from Warply service. The |
| 283 | method returns an array with WLInboxItem objects (campaigns). The caller will probably want to use the return parameter and a timer to update the UI or do any other operation after a certain amount of time that the app remains unregistered and thus, cannot make the call. | 283 | method returns an array with WLInboxItem objects (campaigns). The caller will probably want to use the return parameter and a timer to update the UI or do any other operation after a certain amount of time that the app remains unregistered and thus, cannot make the call. |
| 284 | */ | 284 | */ |
| 285 | +- (NSString*)getAccessToken; | ||
| 286 | + | ||
| 287 | +- (NSString*)getRefreshToken; | ||
| 288 | + | ||
| 289 | +- (NSString*)getClientId; | ||
| 290 | + | ||
| 291 | +- (NSString*)getClientSecret; | ||
| 292 | + | ||
| 285 | - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; | 293 | - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; |
| 286 | 294 | ||
| 287 | - (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; | 295 | - (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; | ... | ... |
| ... | @@ -453,6 +453,57 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -453,6 +453,57 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
| 453 | return [self isRegistrationValid]; | 453 | return [self isRegistrationValid]; |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | +- (NSString*)getAccessToken { | ||
| 457 | + [self createDBIfNeeded]; | ||
| 458 | + [self initDBIfNeeded]; | ||
| 459 | + [self restore]; | ||
| 460 | + NSString *accessToken = [NSString alloc]; | ||
| 461 | + if ([_db tableExists:@"requestVariables"] == YES) { | ||
| 462 | + FMResultSet *accessTokenSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"]; | ||
| 463 | + while ([accessTokenSet next]) { | ||
| 464 | + accessToken = [[accessTokenSet resultDictionary][@"access_token"] stringValue]; | ||
| 465 | + } | ||
| 466 | + return accessToken; | ||
| 467 | + } | ||
| 468 | + return @""; | ||
| 469 | +}; | ||
| 470 | + | ||
| 471 | +- (NSString*)getRefreshToken { | ||
| 472 | + NSString *refreshToken = [NSString alloc]; | ||
| 473 | + if ([_db tableExists:@"requestVariables"] == YES) { | ||
| 474 | + FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"]; | ||
| 475 | + while ([refreshTokenSet next]) { | ||
| 476 | + refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue]; | ||
| 477 | + } | ||
| 478 | + return refreshToken; | ||
| 479 | + } | ||
| 480 | + return @""; | ||
| 481 | +} | ||
| 482 | + | ||
| 483 | +- (NSString*)getClientId { | ||
| 484 | + NSString *clientId = [NSString alloc]; | ||
| 485 | + if ([_db tableExists:@"requestVariables"] == YES) { | ||
| 486 | + FMResultSet *clientIdSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"]; | ||
| 487 | + while ([clientIdSet next]) { | ||
| 488 | + clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue]; | ||
| 489 | + } | ||
| 490 | + return clientId; | ||
| 491 | + } | ||
| 492 | + return @""; | ||
| 493 | +} | ||
| 494 | + | ||
| 495 | +- (NSString*)getClientSecret { | ||
| 496 | + NSString *clientSecret = [NSString alloc]; | ||
| 497 | + if ([_db tableExists:@"requestVariables"] == YES) { | ||
| 498 | + FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"]; | ||
| 499 | + while ([clientSecretSet next]) { | ||
| 500 | + clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue]; | ||
| 501 | + } | ||
| 502 | + return clientSecret; | ||
| 503 | + } | ||
| 504 | + return @""; | ||
| 505 | +} | ||
| 506 | + | ||
| 456 | - (void)getProductsWithSuccessBlock:(NSString*)filter :(void(^)(NSMutableArray *params)) success failureBlock:(void(^)(NSError *error))failure | 507 | - (void)getProductsWithSuccessBlock:(NSString*)filter :(void(^)(NSMutableArray *params)) success failureBlock:(void(^)(NSError *error))failure |
| 457 | { | 508 | { |
| 458 | if (filter == nil) { | 509 | if (filter == nil) { | ... | ... |
| ... | @@ -23,6 +23,7 @@ | ... | @@ -23,6 +23,7 @@ |
| 23 | E67D1EC02810579F00940F01 /* MoreForYouView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EBF2810579F00940F01 /* MoreForYouView.swift */; }; | 23 | E67D1EC02810579F00940F01 /* MoreForYouView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EBF2810579F00940F01 /* MoreForYouView.swift */; }; |
| 24 | E67D1EC228113EED00940F01 /* CouponView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EC128113EED00940F01 /* CouponView.swift */; }; | 24 | E67D1EC228113EED00940F01 /* CouponView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EC128113EED00940F01 /* CouponView.swift */; }; |
| 25 | E67D1EC428113EFD00940F01 /* CouponViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EC328113EFD00940F01 /* CouponViewInterface.swift */; }; | 25 | E67D1EC428113EFD00940F01 /* CouponViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EC328113EFD00940F01 /* CouponViewInterface.swift */; }; |
| 26 | + E67D1EC628117F2400940F01 /* swiftApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = E67D1EC528117F2400940F01 /* swiftApi.swift */; }; | ||
| 26 | E6D8DE6D27A942010006A3A9 /* WarplySDKFrameworkIOS.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */; }; | 27 | E6D8DE6D27A942010006A3A9 /* WarplySDKFrameworkIOS.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */; }; |
| 27 | E6D8DE6E27A942010006A3A9 /* WarplySDKFrameworkIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 28 | E6D8DE6E27A942010006A3A9 /* WarplySDKFrameworkIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; |
| 28 | E6D8DEEE27A942920006A3A9 /* WarplyReactMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DE7527A942910006A3A9 /* WarplyReactMethods.m */; }; | 29 | E6D8DEEE27A942920006A3A9 /* WarplyReactMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DE7527A942910006A3A9 /* WarplyReactMethods.m */; }; |
| ... | @@ -136,8 +137,6 @@ | ... | @@ -136,8 +137,6 @@ |
| 136 | E6D8DF5A27A942920006A3A9 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6D8DEED27A942920006A3A9 /* Media.xcassets */; }; | 137 | E6D8DF5A27A942920006A3A9 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6D8DEED27A942920006A3A9 /* Media.xcassets */; }; |
| 137 | E6D8DF6027A9429E0006A3A9 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5C27A9429E0006A3A9 /* MyApi.m */; }; | 138 | E6D8DF6027A9429E0006A3A9 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D8DF5C27A9429E0006A3A9 /* MyApi.m */; }; |
| 138 | E6D8DF6227A9429E0006A3A9 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DF5E27A9429E0006A3A9 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 139 | E6D8DF6227A9429E0006A3A9 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6D8DF5E27A9429E0006A3A9 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; |
| 139 | - E6EA2F6E2806E32500EC4CF5 /* Coupons.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */; }; | ||
| 140 | - E6EA2F702806E8C200EC4CF5 /* Coupons.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */; }; | ||
| 141 | /* End PBXBuildFile section */ | 140 | /* End PBXBuildFile section */ |
| 142 | 141 | ||
| 143 | /* Begin PBXFileReference section */ | 142 | /* Begin PBXFileReference section */ |
| ... | @@ -158,6 +157,7 @@ | ... | @@ -158,6 +157,7 @@ |
| 158 | E67D1EBF2810579F00940F01 /* MoreForYouView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreForYouView.swift; sourceTree = "<group>"; }; | 157 | E67D1EBF2810579F00940F01 /* MoreForYouView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreForYouView.swift; sourceTree = "<group>"; }; |
| 159 | E67D1EC128113EED00940F01 /* CouponView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponView.swift; sourceTree = "<group>"; }; | 158 | E67D1EC128113EED00940F01 /* CouponView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponView.swift; sourceTree = "<group>"; }; |
| 160 | E67D1EC328113EFD00940F01 /* CouponViewInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponViewInterface.swift; sourceTree = "<group>"; }; | 159 | E67D1EC328113EFD00940F01 /* CouponViewInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponViewInterface.swift; sourceTree = "<group>"; }; |
| 160 | + E67D1EC528117F2400940F01 /* swiftApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = swiftApi.swift; sourceTree = "<group>"; }; | ||
| 161 | E6D8DE6827A942010006A3A9 /* WarplySDKFrameworkIOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WarplySDKFrameworkIOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | 161 | E6D8DE6827A942010006A3A9 /* WarplySDKFrameworkIOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WarplySDKFrameworkIOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 162 | E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WarplySDKFrameworkIOS.h; sourceTree = "<group>"; }; | 162 | E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WarplySDKFrameworkIOS.h; sourceTree = "<group>"; }; |
| 163 | E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = WarplySDKFrameworkIOS.docc; sourceTree = "<group>"; }; | 163 | E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = WarplySDKFrameworkIOS.docc; sourceTree = "<group>"; }; |
| ... | @@ -272,8 +272,6 @@ | ... | @@ -272,8 +272,6 @@ |
| 272 | E6D8DEED27A942920006A3A9 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = SOURCE_ROOT; }; | 272 | E6D8DEED27A942920006A3A9 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = SOURCE_ROOT; }; |
| 273 | E6D8DF5C27A9429E0006A3A9 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; }; | 273 | E6D8DF5C27A9429E0006A3A9 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; }; |
| 274 | E6D8DF5E27A9429E0006A3A9 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; }; | 274 | E6D8DF5E27A9429E0006A3A9 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; }; |
| 275 | - E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Coupons.xib; sourceTree = "<group>"; }; | ||
| 276 | - E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coupons.swift; sourceTree = "<group>"; }; | ||
| 277 | F2447FDBC0B149DFB9DC6E40 /* Pods-WarplySDKFrameworkIOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WarplySDKFrameworkIOS.debug.xcconfig"; path = "Target Support Files/Pods-WarplySDKFrameworkIOS/Pods-WarplySDKFrameworkIOS.debug.xcconfig"; sourceTree = "<group>"; }; | 275 | F2447FDBC0B149DFB9DC6E40 /* Pods-WarplySDKFrameworkIOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WarplySDKFrameworkIOS.debug.xcconfig"; path = "Target Support Files/Pods-WarplySDKFrameworkIOS/Pods-WarplySDKFrameworkIOS.debug.xcconfig"; sourceTree = "<group>"; }; |
| 278 | /* End PBXFileReference section */ | 276 | /* End PBXFileReference section */ |
| 279 | 277 | ||
| ... | @@ -356,9 +354,8 @@ | ... | @@ -356,9 +354,8 @@ |
| 356 | E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */, | 354 | E6D8DE6B27A942010006A3A9 /* WarplySDKFrameworkIOS.h */, |
| 357 | E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */, | 355 | E6D8DE6C27A942010006A3A9 /* WarplySDKFrameworkIOS.docc */, |
| 358 | E655D05928058A72004F913C /* WarplySDKFrameworkIOS-Bridging-Header.h */, | 356 | E655D05928058A72004F913C /* WarplySDKFrameworkIOS-Bridging-Header.h */, |
| 359 | - E6EA2F6D2806E32500EC4CF5 /* Coupons.xib */, | ||
| 360 | - E6EA2F6F2806E8C200EC4CF5 /* Coupons.swift */, | ||
| 361 | E639EFA42808244E00B9DD94 /* MyEmptyClass.swift */, | 357 | E639EFA42808244E00B9DD94 /* MyEmptyClass.swift */, |
| 358 | + E67D1EC528117F2400940F01 /* swiftApi.swift */, | ||
| 362 | ); | 359 | ); |
| 363 | path = WarplySDKFrameworkIOS; | 360 | path = WarplySDKFrameworkIOS; |
| 364 | sourceTree = "<group>"; | 361 | sourceTree = "<group>"; |
| ... | @@ -705,7 +702,6 @@ | ... | @@ -705,7 +702,6 @@ |
| 705 | E6D8DF0D27A942920006A3A9 /* warp_white_forward_button.png in Resources */, | 702 | E6D8DF0D27A942920006A3A9 /* warp_white_forward_button.png in Resources */, |
| 706 | E6D8DEFA27A942920006A3A9 /* WLNativeAdTableViewCell.xib in Resources */, | 703 | E6D8DEFA27A942920006A3A9 /* WLNativeAdTableViewCell.xib in Resources */, |
| 707 | E639EFAB2808347700B9DD94 /* ic_back.png in Resources */, | 704 | E639EFAB2808347700B9DD94 /* ic_back.png in Resources */, |
| 708 | - E6EA2F6E2806E32500EC4CF5 /* Coupons.xib in Resources */, | ||
| 709 | E6D8DF1027A942920006A3A9 /* warp_white_forward_button@2x.png in Resources */, | 705 | E6D8DF1027A942920006A3A9 /* warp_white_forward_button@2x.png in Resources */, |
| 710 | E6D8DEF127A942920006A3A9 /* WLNativeVideoTableViewCell.xib in Resources */, | 706 | E6D8DEF127A942920006A3A9 /* WLNativeVideoTableViewCell.xib in Resources */, |
| 711 | E6D8DEFB27A942920006A3A9 /* WLNativeAdCollectionViewCell.xib in Resources */, | 707 | E6D8DEFB27A942920006A3A9 /* WLNativeAdCollectionViewCell.xib in Resources */, |
| ... | @@ -762,7 +758,6 @@ | ... | @@ -762,7 +758,6 @@ |
| 762 | 1EBEB02D280D69D800BF802C /* GiftsView.swift in Sources */, | 758 | 1EBEB02D280D69D800BF802C /* GiftsView.swift in Sources */, |
| 763 | E67D1EC02810579F00940F01 /* MoreForYouView.swift in Sources */, | 759 | E67D1EC02810579F00940F01 /* MoreForYouView.swift in Sources */, |
| 764 | E6D8DEFC27A942920006A3A9 /* WLCustomNativeAdTableViewCell.m in Sources */, | 760 | E6D8DEFC27A942920006A3A9 /* WLCustomNativeAdTableViewCell.m in Sources */, |
| 765 | - E6EA2F702806E8C200EC4CF5 /* Coupons.swift in Sources */, | ||
| 766 | 1E735FF42810681E0050A298 /* CampaignWebviewInterface.swift in Sources */, | 761 | 1E735FF42810681E0050A298 /* CampaignWebviewInterface.swift in Sources */, |
| 767 | E639EFA3280810E300B9DD94 /* CouponsViewInterface.swift in Sources */, | 762 | E639EFA3280810E300B9DD94 /* CouponsViewInterface.swift in Sources */, |
| 768 | 1EBEB02F280D6AA500BF802C /* GiftsViewInterface.swift in Sources */, | 763 | 1EBEB02F280D6AA500BF802C /* GiftsViewInterface.swift in Sources */, |
| ... | @@ -793,6 +788,7 @@ | ... | @@ -793,6 +788,7 @@ |
| 793 | E6D8DF4727A942920006A3A9 /* AFURLSessionManager.m in Sources */, | 788 | E6D8DF4727A942920006A3A9 /* AFURLSessionManager.m in Sources */, |
| 794 | E6D8DF1927A942920006A3A9 /* WLAnalyticsManager.m in Sources */, | 789 | E6D8DF1927A942920006A3A9 /* WLAnalyticsManager.m in Sources */, |
| 795 | E6D8DF5227A942920006A3A9 /* FMDatabase.m in Sources */, | 790 | E6D8DF5227A942920006A3A9 /* FMDatabase.m in Sources */, |
| 791 | + E67D1EC628117F2400940F01 /* swiftApi.swift in Sources */, | ||
| 796 | E6D8DF1227A942920006A3A9 /* WLPushManager.m in Sources */, | 792 | E6D8DF1227A942920006A3A9 /* WLPushManager.m in Sources */, |
| 797 | E6D8DEF827A942920006A3A9 /* WLNativeAdTableViewCell.m in Sources */, | 793 | E6D8DEF827A942920006A3A9 /* WLNativeAdTableViewCell.m in Sources */, |
| 798 | E6D8DE6D27A942010006A3A9 /* WarplySDKFrameworkIOS.docc in Sources */, | 794 | E6D8DE6D27A942010006A3A9 /* WarplySDKFrameworkIOS.docc in Sources */, | ... | ... |
No preview for this file type
| ... | @@ -3,4 +3,38 @@ | ... | @@ -3,4 +3,38 @@ |
| 3 | uuid = "91478161-56E8-4654-93F2-7756A39480EE" | 3 | uuid = "91478161-56E8-4654-93F2-7756A39480EE" |
| 4 | type = "0" | 4 | type = "0" |
| 5 | version = "2.0"> | 5 | version = "2.0"> |
| 6 | + <Breakpoints> | ||
| 7 | + <BreakpointProxy | ||
| 8 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
| 9 | + <BreakpointContent | ||
| 10 | + uuid = "30B1F0C3-FB6C-4F67-936F-5E2FE28C8D28" | ||
| 11 | + shouldBeEnabled = "No" | ||
| 12 | + ignoreCount = "0" | ||
| 13 | + continueAfterRunningActions = "No" | ||
| 14 | + filePath = "Warply/Warply.m" | ||
| 15 | + startingColumnNumber = "9223372036854775807" | ||
| 16 | + endingColumnNumber = "9223372036854775807" | ||
| 17 | + startingLineNumber = "1166" | ||
| 18 | + endingLineNumber = "1166" | ||
| 19 | + landmarkName = "-verifyTicketWithSuccessBlock:::failureBlock:" | ||
| 20 | + landmarkType = "7"> | ||
| 21 | + </BreakpointContent> | ||
| 22 | + </BreakpointProxy> | ||
| 23 | + <BreakpointProxy | ||
| 24 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
| 25 | + <BreakpointContent | ||
| 26 | + uuid = "624123AE-FD55-4FBC-8B32-A1449A16F8F7" | ||
| 27 | + shouldBeEnabled = "Yes" | ||
| 28 | + ignoreCount = "0" | ||
| 29 | + continueAfterRunningActions = "No" | ||
| 30 | + filePath = "WarplySDKFrameworkIOS/CouponsView.swift" | ||
| 31 | + startingColumnNumber = "9223372036854775807" | ||
| 32 | + endingColumnNumber = "9223372036854775807" | ||
| 33 | + startingLineNumber = "212" | ||
| 34 | + endingLineNumber = "212" | ||
| 35 | + landmarkName = "goBack()" | ||
| 36 | + landmarkType = "7"> | ||
| 37 | + </BreakpointContent> | ||
| 38 | + </BreakpointProxy> | ||
| 39 | + </Breakpoints> | ||
| 6 | </Bucket> | 40 | </Bucket> | ... | ... |
| 1 | -// | ||
| 2 | -// Coupons.swift | ||
| 3 | -// WarplySDKFrameworkIOS | ||
| 4 | -// | ||
| 5 | -// Created by Βασιλης Σκουρας on 13/4/22. | ||
| 6 | -// | ||
| 7 | - | ||
| 8 | -import UIKit | ||
| 9 | - | ||
| 10 | -extension UIViewController { | ||
| 11 | - | ||
| 12 | - class func loadController() -> Self { | ||
| 13 | - return Self(nibName: String(describing: self), bundle: nil) | ||
| 14 | - //Or You can use this as well | ||
| 15 | - //Self.init(nibName: String(describing: self), bundle: nil) | ||
| 16 | - } | ||
| 17 | -} | ||
| 18 | - | ||
| 19 | -public class Coupons: UIViewController { | ||
| 20 | - | ||
| 21 | - @IBOutlet weak var myScrollView: UIScrollView! | ||
| 22 | - | ||
| 23 | - public override func viewDidLoad() { | ||
| 24 | - super.viewDidLoad() | ||
| 25 | -// let corners = UIRectCorner(arrayLiteral: [ | ||
| 26 | -// UIRectCorner.topLeft, | ||
| 27 | -// ]) | ||
| 28 | -// let cornerRadii = CGSize( | ||
| 29 | -// width: 10, | ||
| 30 | -// height: 10 | ||
| 31 | -// ) | ||
| 32 | -// let maskPath = UIBezierPath( | ||
| 33 | -// roundedRect: view.bounds, | ||
| 34 | -// byRoundingCorners: corners, | ||
| 35 | -// cornerRadii: cornerRadii | ||
| 36 | -// ) | ||
| 37 | -// let maskLayer = CAShapeLayer() | ||
| 38 | -// maskLayer.path = maskPath.cgPath | ||
| 39 | -// maskLayer.frame = view.bounds | ||
| 40 | -// myScrollView.layer.mask = maskLayer | ||
| 41 | - // Do any additional setup after loading the view. | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - /* | ||
| 46 | - // MARK: - Navigation | ||
| 47 | - | ||
| 48 | - // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 49 | - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
| 50 | - // Get the new view controller using segue.destination. | ||
| 51 | - // Pass the selected object to the new view controller. | ||
| 52 | - } | ||
| 53 | - */ | ||
| 54 | - | ||
| 55 | -} |
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
| 3 | - <device id="retina6_1" orientation="portrait" appearance="light"/> | ||
| 4 | - <dependencies> | ||
| 5 | - <deployment identifier="iOS"/> | ||
| 6 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/> | ||
| 7 | - <capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
| 8 | - <capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
| 9 | - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| 10 | - </dependencies> | ||
| 11 | - <objects> | ||
| 12 | - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Coupons" customModule="WarplySDKFrameworkIOS" customModuleProvider="target"> | ||
| 13 | - <connections> | ||
| 14 | - <outlet property="myScrollView" destination="SHV-Vg-A8P" id="dzS-Na-cRH"/> | ||
| 15 | - <outlet property="view" destination="iN0-l3-epB" id="wLC-JN-Nyj"/> | ||
| 16 | - </connections> | ||
| 17 | - </placeholder> | ||
| 18 | - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
| 19 | - <view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
| 20 | - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
| 21 | - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 22 | - <subviews> | ||
| 23 | - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Όλα τα κουπόνια μου" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sU1-BM-nPc"> | ||
| 24 | - <rect key="frame" x="126.5" y="63" width="161.5" height="21"/> | ||
| 25 | - <fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
| 26 | - <nil key="textColor"/> | ||
| 27 | - <nil key="highlightedColor"/> | ||
| 28 | - </label> | ||
| 29 | - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" image="ic_back" translatesAutoresizingMaskIntoConstraints="NO" id="DSk-ym-fZV"> | ||
| 30 | - <rect key="frame" x="20" y="63" width="24" height="21"/> | ||
| 31 | - <accessibility key="accessibilityConfiguration" identifier="ic_back"/> | ||
| 32 | - <constraints> | ||
| 33 | - <constraint firstAttribute="height" constant="17" id="dvj-RN-g0D"/> | ||
| 34 | - <constraint firstAttribute="width" constant="20" id="y3w-1z-hQx"/> | ||
| 35 | - </constraints> | ||
| 36 | - </imageView> | ||
| 37 | - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SHV-Vg-A8P"> | ||
| 38 | - <rect key="frame" x="0.0" y="113" width="414" height="783"/> | ||
| 39 | - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 40 | - <viewLayoutGuide key="contentLayoutGuide" id="Kj4-MW-egz"/> | ||
| 41 | - <viewLayoutGuide key="frameLayoutGuide" id="KT3-60-7Kp"/> | ||
| 42 | - </scrollView> | ||
| 43 | - </subviews> | ||
| 44 | - <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> | ||
| 45 | - <color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
| 46 | - <constraints> | ||
| 47 | - <constraint firstItem="sU1-BM-nPc" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="RLg-Ad-dUB"/> | ||
| 48 | - </constraints> | ||
| 49 | - <point key="canvasLocation" x="137.68115942028987" y="95.758928571428569"/> | ||
| 50 | - </view> | ||
| 51 | - </objects> | ||
| 52 | - <resources> | ||
| 53 | - <image name="ic_back" width="16.5" height="13.5"/> | ||
| 54 | - <systemColor name="systemBackgroundColor"> | ||
| 55 | - <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
| 56 | - </systemColor> | ||
| 57 | - </resources> | ||
| 58 | -</document> |
| ... | @@ -113,7 +113,7 @@ extension CouponsView { | ... | @@ -113,7 +113,7 @@ extension CouponsView { |
| 113 | HStack { | 113 | HStack { |
| 114 | Image("ic_back", bundle: Bundle(for: MyEmptyClass.self)) | 114 | Image("ic_back", bundle: Bundle(for: MyEmptyClass.self)) |
| 115 | .resizable() | 115 | .resizable() |
| 116 | - .frame(width: self.uiscreen.height * 0.022, height: self.uiscreen.height * 0.02) | 116 | + .frame(width: self.uiscreen.height * 0.022, height: self.uiscreen.height * 0.04) |
| 117 | .offset(y: self.uiscreen.height * 0.015) | 117 | .offset(y: self.uiscreen.height * 0.015) |
| 118 | } | 118 | } |
| 119 | } | 119 | } | ... | ... |
| ... | @@ -8,10 +8,12 @@ | ... | @@ -8,10 +8,12 @@ |
| 8 | #ifndef MyApi_h | 8 | #ifndef MyApi_h |
| 9 | #define MyApi_h | 9 | #define MyApi_h |
| 10 | #import <UIKit/UIKit.h> | 10 | #import <UIKit/UIKit.h> |
| 11 | -@class Coupons; | 11 | +@class Warply; |
| 12 | 12 | ||
| 13 | @interface MyApi : NSObject | 13 | @interface MyApi : NSObject |
| 14 | 14 | ||
| 15 | +@property (nonatomic, weak) Warply *warply; | ||
| 16 | + | ||
| 15 | + (void)init:(NSDictionary *)launchOptions uuid:(NSString*)uuid merchantId:(NSString*)merchantId lang:(NSString*)lang; | 17 | + (void)init:(NSDictionary *)launchOptions uuid:(NSString*)uuid merchantId:(NSString*)merchantId lang:(NSString*)lang; |
| 16 | - (void) setToStage; | 18 | - (void) setToStage; |
| 17 | - (void) setLang:(NSString*) lang; | 19 | - (void) setLang:(NSString*) lang; |
| ... | @@ -21,6 +23,7 @@ | ... | @@ -21,6 +23,7 @@ |
| 21 | - (UIViewController *) openWallet:(UIView*) parentView; | 23 | - (UIViewController *) openWallet:(UIView*) parentView; |
| 22 | - (UIViewController *) openMoreForYou:(UIView*) parentView; | 24 | - (UIViewController *) openMoreForYou:(UIView*) parentView; |
| 23 | - (UIViewController *) openCampaign:(UIView*) parentView campaign:(NSString*) campaign; | 25 | - (UIViewController *) openCampaign:(UIView*) parentView campaign:(NSString*) campaign; |
| 26 | +- (NSDictionary *) provideInfoForCampaign; | ||
| 24 | - (void) applicationDidEnterBackground:(UIApplication *)application; | 27 | - (void) applicationDidEnterBackground:(UIApplication *)application; |
| 25 | - (void) applicationWillEnterForeground:(UIApplication *)application; | 28 | - (void) applicationWillEnterForeground:(UIApplication *)application; |
| 26 | - (void) applicationDidBecomeActive:(UIApplication *)application; | 29 | - (void) applicationDidBecomeActive:(UIApplication *)application; | ... | ... |
| ... | @@ -8,6 +8,7 @@ | ... | @@ -8,6 +8,7 @@ |
| 8 | #import <Foundation/Foundation.h> | 8 | #import <Foundation/Foundation.h> |
| 9 | #import "MyApi.h" | 9 | #import "MyApi.h" |
| 10 | #import "Warply.h" | 10 | #import "Warply.h" |
| 11 | +#import "WLUtils.h" | ||
| 11 | 12 | ||
| 12 | #import <WarplySDKFrameworkIOS/WarplySDKFrameworkIOS-Swift.h> | 13 | #import <WarplySDKFrameworkIOS/WarplySDKFrameworkIOS-Swift.h> |
| 13 | 14 | ||
| ... | @@ -80,6 +81,19 @@ NSString *LANG; | ... | @@ -80,6 +81,19 @@ NSString *LANG; |
| 80 | return campaignViewController; | 81 | return campaignViewController; |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 84 | +- (NSDictionary *) provideInfoForCampaign { | ||
| 85 | + NSMutableDictionary* info = [[NSMutableDictionary alloc] init]; | ||
| 86 | + info[@"web_id"] = [Warply sharedService].webId; | ||
| 87 | + info[@"app_uuid"] = [WLKeychain getStringForKey:@"NBAPPUuid"]; | ||
| 88 | + info[@"api_key"] = self.warply.apiKey; | ||
| 89 | + Warply* warplyInstance = [[Warply alloc] init]; | ||
| 90 | + info[@"access_token"] = [warplyInstance getAccessToken]; | ||
| 91 | + info[@"refresh_token"] = [warplyInstance getRefreshToken]; | ||
| 92 | + info[@"client_id"] = [warplyInstance getClientId]; | ||
| 93 | + info[@"client_secret"] = [warplyInstance getClientSecret]; | ||
| 94 | + return info; | ||
| 95 | +} | ||
| 96 | + | ||
| 83 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 97 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 84 | - (void)applicationDidEnterBackground:(UIApplication *)application | 98 | - (void)applicationDidEnterBackground:(UIApplication *)application |
| 85 | { | 99 | { | ... | ... |
| 1 | +// | ||
| 2 | +// swiftApi.swift | ||
| 3 | +// WarplySDKFrameworkIOS | ||
| 4 | +// | ||
| 5 | +// Created by Βασιλης Σκουρας on 21/4/22. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import WarplySDKFrameworkIOS | ||
| 10 | + | ||
| 11 | +open class swiftApi { | ||
| 12 | + | ||
| 13 | + public func getUserTag() -> String { | ||
| 14 | + return "1" | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + public func setDFY(couponCode: String, merchantId: String) { | ||
| 18 | + | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public func setActiveDFYCoupons(campaignIds: Array<String>) { | ||
| 22 | + | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public func setCCMSLoyaltyCampaigns(campaigns: Array<Dictionary<String, String>>) { | ||
| 26 | + | ||
| 27 | + } | ||
| 28 | +} |
-
Please register or login to post a comment