# BSPHP — bsphp.app.demo.card (iOS card-mode demo app)

## Overview

SwiftUI iOS sample for BSPHP prepaid-card / license-key login and related APIs. The AppEn URL, mutualKey, and RSA key pair must match the same app in the BSPHP admin.

## Directory tree

```
bsphp.app.demo.card/
├── bsphp.app.demo.card.xcodeproj/     Xcode project
├── bsphp.app.demo.card/               Main app target
│   ├── bsphp_app_demo_cardApp.swift   Entry point
│   ├── ContentView.swift              BSPHPCardConfig
│   ├── CardMainControlPanelView.swift Renew / buy-card links
│   ├── bsphp_api_http/                BSPHPClient, BSPHPCrypto
│   ├── Assets.xcassets/
│   └── Preview Content/
├── bsphp.app.demo.cardTests/
├── bsphp.app.demo.cardUITests/
├── 效果图-配置说明/
├── 说明中文.md / 说明繁体.md / 说明英文.md
└── (Build output in DerivedData)
```

## Key paths

| Path | Role |
|------|------|
| `bsphp.app.demo.card.xcodeproj/` | Open in Xcode |
| `bsphp.app.demo.card/` | Card UI and `BSPHPCardConfig` |
| `bsphp_api_http/` | AppEn client and crypto |
| `效果图-配置说明/` | Admin setup screenshots |

## Configuration

1. Edit private enum **BSPHPCardConfig** in `bsphp.app.demo.card/ContentView.swift` (`url`, `mutualKey`, RSA keys).
2. For sale/renew URLs, align **BSPHPCardSaleWeb** in `CardMainControlPanelView.swift` (e.g. `daihao`) with the backend.
3. Run the main app scheme on Simulator or a signed device.

## Configuration screenshots

![](效果图-配置说明/1.png)

![](效果图-配置说明/2.png)

![](效果图-配置说明/3.png)

![](效果图-配置说明/4.png)

![](效果图-配置说明/5.png)

![](效果图-配置说明/6.png)

![](效果图-配置说明/7.png)

![](效果图-配置说明/8.png)

## Build output

**Xcode:** **Product → Show Build Folder in Finder** → locate the `.app`.
