Integration Methods Overview
NetFUNNEL iOS Agent supports Code-based Integration to apply traffic control in your iOS application. Unlike web agents, mobile native agents only support code-based integration, which is divided into two control types based on how keys are managed:
- Code-based Integration - Basic Control: Controls entry speed (key returned quickly)
- Code-based Integration - Section Control: Maintains fixed capacity (key held until section exit)
📄️ Basic Control Integration
Complete guide for implementing Basic Control with NetFUNNEL iOS Agent using code-based integration.
📄️ Section Control Integration
Complete guide for implementing Section Control with NetFUNNEL iOS Agent using code-based integration.
Code-based Integration
What it does:
- Traffic control is applied by calling NetFUNNEL functions in your iOS code
- You have full control over when and where to apply waiting rooms
- Functions are called at specific points in your app's flow
User Experience (UX):
- When a waiting room is needed, a native waiting room UI is displayed
- Users wait in the app until entry is allowed
- Seamless integration with your app's design and flow
Characteristics:
- Precise control over traffic control timing
- Native mobile UI experience
- Best for mobile apps and complex user flows
Key Difference Between Control Types:
- Basic Control (Code-based Integration): Controls entry speed (key returned quickly)
- Section Control (Code-based Integration): Maintains fixed capacity (key held until section exit)
Control Types
Code-based integration is further divided into two control types:
| Control Type | Purpose | Best For | Key Management |
|---|---|---|---|
| Code-based Integration - Basic Control | Controls entry speed | Button clicks, API calls, view controller entry | Key returned quickly after action completes |
| Code-based Integration - Section Control | Maintains concurrent user count | Multi-step processes, checkout flows | Key held until section exit (entire process completes) |
Control Type Comparison
Code-based Integration - Basic Control
What it does:
- Controls how fast users can enter your service
- Each user gets a key when they start an action
- Key is returned quickly when the action completes
- Next user can enter only after previous user returns their key
Key Management: Key is returned immediately after the specific action completes (e.g., view controller loads, API call finishes).
Use cases:
- Button click rate limiting
- API call throttling
- Login attempt control
- View controller entry protection
Example flow:
Code-based Integration - Section Control
What it does:
- Maintains a fixed number of concurrent users in a specific section
- Users wait in queue until a slot becomes available
- Key is held until user completes the entire section
- Next user enters only when current user exits the section
Key Management: Key is held throughout the entire multi-step process, only returned when the entire section/process is complete (e.g., checkout finished, payment processed).
Use cases:
- Checkout process control
- Payment flow management
- Multi-step form completion
- Resource-intensive operations
Example flow:
Decision Matrix
| Your Need | Recommended Control Type | Key Management Strategy |
|---|---|---|
| "I want to limit how fast users can tap buttons" | Basic Control (Code-based Integration) | Quick key return - protect individual actions |
| "I want to limit how many users can checkout simultaneously" | Section Control (Code-based Integration) | Hold key until checkout complete - control capacity |
| "I want to protect my login screen" | Basic Control (Code-based Integration) | Quick key return - simple entry protection |
| "I want to control a multi-step process" | Section Control (Code-based Integration) | Hold key until process complete - maintain occupancy |
| "I want to throttle API calls" | Basic Control (Code-based Integration) | Quick key return - rate limiting per call |
| "I want to control payment processing" | Section Control (Code-based Integration) | Hold key until payment complete - resource management |
Implementation Complexity
Code-based Integration - Basic Control
- Setup: Simple
- Code: Minimal
- Maintenance: Low
- Key Management: Simple (quick return)
- Best for: Quick implementation, simple use cases
Code-based Integration - Section Control
- Setup: Moderate
- Code: More complex
- Maintenance: Medium
- Key Management: Complex (hold until complete)
- Best for: Complex workflows, resource management
Can I Use Both Control Types?
Yes! You can use both control types in the same application:
- Swift
- Objective-C
// Basic Control for login
func handleLogin() {
Netfunnel.shared.nfStart(projectKey: "login_project", segmentKey: "login_segment")
}
// Section Control for checkout
func startCheckout() {
Netfunnel.shared.nfStartSection(projectKey: "checkout_project", segmentKey: "checkout_segment")
}
// Basic Control for login
- (void)handleLogin {
[[Netfunnel shared] nfStartWithProjectKey:@"login_project" segmentKey:@"login_segment"];
}
// Section Control for checkout
- (void)startCheckout {
[[Netfunnel shared] nfStartSectionWithProjectKey:@"checkout_project" segmentKey:@"checkout_segment"];
}
Common patterns:
- Use Basic Control (Code-based Integration) for entry points (login, main features) - quick key return after activity loads
- Use Section Control (Code-based Integration) for critical processes (checkout, payment) - hold key until entire process complete
Need a basic project to practice with? Check out our Sample Projects which include an iOS Application (Single ViewController) template ready for NetFUNNEL SDK integration practice.