This must occur before using any functionality of the SDK. If it is not called first, subsequent calls will cause the app to terminate!
TradeItSDK.configure( apiKey: API_KEY, // obtained by registering for the Develoer Portal at: http://developers.trade.it/ oAuthCallbackUrl: URL(string: "yourAppScheme://completeOAuth")!, // Use the existing deep link scheme for your app or register a new one environment: TradeItEmsTestEnv )
There are two ways to use the TradeIt SDK:
Linked brokers (and the associated trading account info) are persisted on the device between uses of your app so that users only need to link their broker with your app once. The linked brokers will be reloaded when your app is relaunched and the
TradeItSDK is reinstantiated with the call to
TradeItSDK.configure(). Persistence is implemented using the secure iOS keychain.
Important: Both the test and production environments use the brokers’ production environments!