Skip to content

platfone-com/temp-number-ios

Repository files navigation

Sample iOS App for Temp-Number Backend

This sample iOS app designed for developers to demonstrate the main flows and integration with the Temp-Number Backend. The app allows users to purchase virtual mobile numbers to receive SMS messages online, SMS activation, OTP verification, and SMS Activate workflows. The Temp-Number Backend is a ready-to-use open-source backend, providing all necessary functionality for seamless app integration and SMS management.

Sample App Screenshots:

Screen 1 Screen 2 Screen 3 Screen 4 Screen 5 Screen 6 Screen 7 Screen 8

Main Features

  1. Primary App Features

    • User Authentication: Supports Firebase Authentication (Google Sign-In, Email, etc.).
    • Service and Country Pricing: Displays pricing for selected services and countries.
    • Temporary Number Ordering: Users can order numbers and manage active and expired numbers.
    • SMS Handling: Receives and displays SMS messages.
    • Report Issues: Users can submit and track issue reports.
    • Payments: Supports Apple In-App Purchases and Stripe for account balance top-ups.
    • Transaction History: Provides a record of financial transactions.
  2. Backend

  3. Payments (Apple In-App Purchases & Stripe)

    • Apple In-App Purchases and Stripe are integrated for secure balance top-ups, with backend handling verification for purchases and refunds.

Getting Started

Watch the guide on YouTube

Temp-Number iOS guide video

Follow these steps to set up and run the app on your local machine.

Prerequisites

Step 1: Clone the Repository

Clone this repository to your local machine.

Step 2: Update Bundle Identifier

  1. In Xcode, go to your target’s General tab, select your Team, and update the Bundle Identifier to match your App Store Connect settings.
  2. Create a new app in App Store Connect using the same bundle ID.

Step 3: Set Up Firebase

  1. Configure the API endpoint:

    • After the installer finishes, copy the Backend API URL.
    • In the Config.xcconfig file, set the BACKEND_API_URL value (by default, append /api to the end of the domain).
  2. Add Firebase to Your iOS Project:

  3. Set Up Firebase Authentication (if you use FirebaseUI for authentication):

    • Go to Authentication > Settings > User actions in the Firebase console.
    • Disable email enumeration protection (enable it if you use your own authentication UI).

Step 4: Configure Payments

The app supports Apple In-App Purchases and Stripe payments. Configure at least one payment method:

Apple In-App Purchases (Optional)

  1. Add Products in App Store Connect:
    • Create product IDs in App Store Connect.
    • Example product IDs: one_dollar_purchase_activate, five_dollar_purchase_activate, etc.
  2. Update ProductInfo.swift:
    • Update ProductInfo.swift to include your product IDs.
  3. Configure Merchant ID (Optional):
    • Optionally add a Merchant ID via the Apple Developer portal or directly in Xcode under Signing & Capabilities.
  4. Update Backend Parameters:
    • Open the backend configuration file: .../temp-number-deploy/config/env/backend.env.
    • Enable payments by setting APPSTORE_ENABLED=true.
    • Set your app bundle identifier and app ID in APPSTORE_BUNDLE_ID and APPSTORE_APP_ID.
    • Set the same product identifiers in the backend configuration file parameter APPSTORE_PRODUCTS.

Stripe Payments (Optional)

  1. Set Up Stripe:
  2. URL Scheme:
    • Add a URL Type in Xcode with a custom URL scheme under the target’s Info tab.
    • Update the URL_SCHEME in the Config.xcconfig file with your URL scheme.
  3. Update Backend Parameters:
    • Open the backend configuration file: .../temp-number-deploy/config/env/backend.env.
    • Enable payments by setting STRIPE_ENABLED=true.
    • Set the keys according to your Stripe configuration.

After updating payment settings, restart the backend configuration or deployment script to apply the new parameters.

Testing Payments:

Step 5: Build and Run the Project

  1. Open the project in Xcode.
  2. Wait for the dependencies to synchronize.
  3. Connect an iPhone or open a simulator.
  4. Click Run in Xcode.

License

This project is licensed under the MIT License with an API Restriction Clause. You may use it in personal and commercial projects with the Temp-Number Retail API. Refer to the LICENSE file for details.

About

Temp Number iOS example app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages