Skip to content

Commit 3a1b32f

Browse files
authored
Merge pull request #2 from docomodigital/develop
add log on main app
2 parents 416dcb3 + 8240098 commit 3a1b32f

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

Application Test/Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
23-
<key>NSAppTransportSecurity</key>
24-
<dict>
25-
<key>NSAllowsArbitraryLoads</key>
26-
<true/>
27-
</dict>
23+
<key>NSAppTransportSecurity</key>
24+
<dict>
25+
<key>NSAllowsArbitraryLoads</key>
26+
<true/>
27+
</dict>
2828
<key>UIApplicationSceneManifest</key>
2929
<dict>
3030
<key>UIApplicationSupportsMultipleScenes</key>

Application Test/ViewController.swift

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,18 @@ import UIKit
1212

1313
class ViewController: UIViewController {
1414
@IBOutlet var logTextView: UITextView!
15-
15+
internal var dcbCompletion: DCBUserManagerCheckCompletion?
1616
override func viewDidLoad() {
1717
super.viewDidLoad()
1818

1919
setupLogging()
2020

21-
DCBUserManager(client: Credential.dcbClient, loggingIsEnabled: Credential.logging).checkFlowDCB(isActive: false) { date in
22-
if let _ = DCBUserManager.dcbUser {
23-
print("User Docomo Digital")
24-
if let date = date {
25-
print("User is subscribed in date \(date)")
26-
} else {
27-
print("User expired, not subscribed. User must pay again to access the product")
28-
}
29-
} else {
30-
print("Normal user discover the app from AppStore")
31-
}
21+
guard let dcbCompletion = dcbCompletion else {
22+
print("the callback is nil. Please, assign it")
23+
return
3224
}
25+
26+
DCBUserManager(client: Credential.dcbClient, loggingIsEnabled: Credential.logging).checkFlowDCB(isActive: false, completion: dcbCompletion)
3327
}
3428
}
3529

@@ -43,12 +37,19 @@ extension ViewController {
4337

4438
logTextView.insertText("DCB FLOW\n")
4539

46-
let _: DCBUserManagerCheckCompletion = { date in
47-
guard let date = date else {
48-
self.logTextView.insertText("\n\nDCB FLOW FINISHED WITHOUT EXPIRATION TIME")
49-
return
40+
dcbCompletion = { date in
41+
42+
if let _ = DCBUserManager.dcbUser {
43+
self.logTextView.insertText("\n● User Docomo Digital \n")
44+
45+
if let date = date {
46+
self.logTextView.insertText("\n● DCB FLOW FINISHED WITHOUT EXPIRATION TIME WITH DATE: \(date) \n")
47+
} else {
48+
self.logTextView.insertText("\n● User expired, not subscribed. User must pay again to access the product \n")
49+
}
50+
} else {
51+
self.logTextView.insertText("\n● Normal user discover the app from AppStore \n")
5052
}
51-
self.logTextView.insertText("DCB FLOW FINISHED WITHOUT EXPIRATION TIME WITH DATE: \(date)")
5253
}
5354
}
5455

DCBApplication.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
255255
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
256256
MTL_FAST_MATH = YES;
257-
PRODUCT_BUNDLE_IDENTIFIER = "com.docomodigital.Application-for-DCB";
257+
PRODUCT_BUNDLE_IDENTIFIER = com.docomodigital.dcbtestApp;
258258
PRODUCT_NAME = "$(TARGET_NAME)";
259259
SWIFT_VERSION = 5.0;
260260
TARGETED_DEVICE_FAMILY = "1,2";
@@ -279,7 +279,7 @@
279279
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
280280
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
281281
MTL_FAST_MATH = YES;
282-
PRODUCT_BUNDLE_IDENTIFIER = "com.docomodigital.Application-for-DCB";
282+
PRODUCT_BUNDLE_IDENTIFIER = com.docomodigital.dcbtestApp;
283283
PRODUCT_NAME = "$(TARGET_NAME)";
284284
SWIFT_VERSION = 5.0;
285285
TARGETED_DEVICE_FAMILY = "1,2";

0 commit comments

Comments
 (0)