Skip to main content

Development, Testing, and Sample App

This section provides guidance on development practices, testing strategies, and using the sample application for the Entrupy iOS SDK.

Development Considerations

  • Permissions: Ensure your app correctly requests necessary permissions (e.g., Camera access via Info.plist) as outlined in the App Registration and Permissions guide.
  • Authorization Flow: Implement the SDK user authorization flow robustly. Remember that a valid authorization token is a prerequisite for most SDK operations. Refer to SDK User Authorization and Essential Backend Integration Tasks.
  • Delegate Patterns: Correctly implement all relevant SDK delegate protocols (EntrupyLoginDelegate, EntrupyCaptureDelegate, EntrupySearchDelegate, EntrupyFlagDelegate, etc.) to handle callbacks for various SDK operations.
  • Error Handling: Thoroughly handle potential errors from SDK methods and delegate callbacks. Refer to the Error Code Reference for details on specific error codes.
  • Background Handling: If your app needs to handle background events related to SDK operations (like uploads/downloads), ensure you implement interceptApplication as described in Handling Background Tasks.
  • API Interaction: Be mindful of API Rate Limits when your app or backend interacts with Entrupy APIs.

Testing Strategies

Simulator Limitations

  • Camera Access: The iOS Simulator cannot access a physical camera. Therefore, the full Entrupy authentication capture flow, which requires capturing images of an item, cannot be tested on the simulator.
  • Recommendation: While you can test UI elements, navigation, and non-camera-dependent SDK logic (like login, search, displaying previously fetched results) on the simulator, end-to-end testing of the authentication submission process must be performed on real iOS devices.

End-to-End Testing on Devices

  • Use physical iOS devices to test the entire authentication workflow, including:
    • SDK login and authorization.
    • Starting the capture flow (startCapture).
    • Image capture and submission.
    • Receiving and handling capture delegate callbacks (success, cancel, timeout, error).
    • Displaying results in the Detail View or your custom UI.
    • Testing post-authentication operations like flagging results and searching submissions.
  • Test with various item types and under different network conditions (Wi-Fi, cellular) if applicable to your use case.

Test Users and Data

  • Test Environment: Entrupy may provide a staging or test environment for development and testing purposes. Clarify this with your Entrupy contact.
  • Test User Accounts: As mentioned in the rate limiting section, test user accounts often have higher rate limits for login, which is beneficial for automated testing or frequent manual testing of the login flow.
  • Sample Data: Inquire about the availability of sample or test data that can be used to populate results for UI testing or to test search functionality without performing live authentications repeatedly.

Sample Application

Entrupy provides a sample iOS application that demonstrates how to integrate and use the SDK. This sample app can be an invaluable resource for:

  • Understanding how to initialize and configure the SDK.
  • Seeing practical examples of implementing delegate methods.
  • Observing how to call various SDK functions like startCapture, searchSubmissions, setFlag, etc.
  • Reviewing example implementations of UI components that interact with the SDK.

Find the sample application here.