Skip to content

Commit 87ba60e

Browse files
committed
Chaning activate and deactivate calls with Grocery Express
1 parent 165db3d commit 87ba60e

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

Examples/GroceryExpress/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2323
ConnectButtonController.synchronizationLoggingEnabled = true
2424
ConnectButtonController.analyticsEnabled = true
2525
ConnectButtonController.initialize(options: .init(enableSDKBackgroundProcess: true, showPermissionsPrompts: true))
26-
ConnectButtonController.activate(connections: [DisplayInformation.locationConnection.connectionId])
2726
ConnectButtonController.setBackgroundProcessClosures {
2827
print("Background process started!")
2928
} expirationHandler: {

Examples/GroceryExpress/ConnectionCredentials.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ class ConnectionCredentials: ConnectionCredentialProvider, CustomStringConvertib
5858
Keys.token : token
5959
]
6060
UserDefaults.standard.set(user, forKey: Keys.user)
61+
ConnectButtonController.activate(
62+
connections: [DisplayInformation.locationConnection.connectionId],
63+
lifecycleSynchronizationOptions: .all
64+
)
6165
}
6266

6367
/// Clears the active IFTTT session
6468
func logout() {
6569
userToken = nil
6670
UserDefaults.standard.set(nil, forKey: Keys.user)
71+
ConnectButtonController.deactivate()
6772
}
6873

6974
/// Creates an instance of ConnectionCredentials

Examples/GroceryExpress/SettingsViewController.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,9 @@ class SettingsViewController: UIViewController {
5757
}
5858
@IBAction func loginTapped(_ sender: Any) {
5959
attemptLogin()
60-
ConnectButtonController.activate(
61-
connections: [DisplayInformation.locationConnection.connectionId],
62-
lifecycleSynchronizationOptions: .all
63-
)
6460
}
6561
@IBAction func logoutTapped(_ sender: Any) {
6662
ConnectionCredentials(settings: settings).logout()
67-
ConnectButtonController.deactivate()
6863
update()
6964
}
7065

0 commit comments

Comments
 (0)