fiskaly / fiskaly-sdk-swift

fiskaly Cloud-TSE SDK for Swift/iOS
MIT License
5 stars 5 forks source link

New example app #39

Closed Angelastic closed 2 years ago

Angelastic commented 3 years ago

Motivation

This adds a new example app with an interactive UI to do everything from creating a TSS to signing a transaction, in both V1 and V2, along with some tools for troubleshooting while testing (e.g. the 'List TSS' screen to disable a TSS in one tap if there are too many active.) It is intended as a source of sample code to show the difference between sign API V1 and V2, and as a way for developers to experiment with the API using known-good implementations and understand when each action can be performed.

Test Plan

To use the example app, open /Users/angelabrett/fiskaly-sdk-swift/Examples/FiskalyExampleApp/FiskalyExampleApp.xcodeproj, set the environment variables for the API version(s) you want to use in the scheme (API_KEY and API_SECRET for v1, API_KEY_V2 and API_SECRET_V2 for v2) and run the app. Choose between the V1 and V2 APIs with the tabs at the bottom. From there you can click on the various actions (in V2, these are based on the ones in the Postman collection) and view the http status and response from each one. If an action is disabled, it's because it is not possible until other actions are run first, e.g. it is not possible to create a client before creating or selecting a TSS. Check the can… methods in the FiskalyzerV1 and FiskalyzerV2.swift files to see how this is determined.