Skip to main content
Version: 4.6.1-saas

Code-based Integration - Basic Control

Control entry rate by calling NetFUNNEL functions in Flutter application code.

Integration Method

Basic control is one of two control types available in code-based integration. To compare with section control and choose the most suitable approach for your use case, refer to the Integration Methods Overview.

Detailed Explanation

For detailed information about how basic control works, optimal use cases, use cases, etc., refer to the "Code-based Integration - Basic Control" section in the Common Guide document.


Prerequisites


Create Segment

  1. Go to NetFUNNEL Console → ProjectsSegment
  2. Click the + button to create a new segment
  3. Select Basic Control and click Next
  4. Enter segment name and complete setup

For detailed information about creating segments, refer to the Basic Control Segment document.


Start Function

Function Name: nfStart

Description: Call the function at the point where you want to apply waiting to issue a key and display the waiting room.

Parameters:

ParameterTypeDescription
projectKeyStringBasic control project key from console
segmentKeyStringBasic control segment key from console
callbackNetfunnelCallbackCustom callback function for waiting room event handling
contextBuildContextBuildContext of the screen where the waiting room is applied

Example:

import 'package:netfunnel_flutter/netfunnel_flutter.dart';
import 'package:flutter/material.dart';

class NetfunnelHandler extends NetfunnelCallback {
@override
void onSuccess(int statusCode, String message) {
// Logic to handle when queue is passed
}

@override
void onError(int statusCode, String message) {
// Logic to handle when error occurs
}

@override
void onNetworkError(int statusCode, String message) {
// Logic to handle when network error occurs
}

@override
void onBlock(int statusCode, String message) {
// Logic to handle when user entry is blocked
}

@override
void onClose(int statusCode, String message) {
// Logic to handle when user cancels waiting
}
}

void handleButtonPress(BuildContext context) {
Netfunnel.instance.nfStart(
projectKey: '{{PROJECT_KEY}}',
segmentKey: '{{SEGMENT_KEY}}',
callback: NetfunnelHandler(),
context: context,
);
}
Callback Function Implementation

For how to implement callback functions, refer to the Callback Functions section.


Stop Function

Function Name: nfStop

Description: Used to return the key after entry is completed.

If the stop function is not executed, it is automatically returned according to the segment's timeout setting.

Parameters:

ParameterTypeDescription
projectKeyStringBasic control project key from console
segmentKeyStringBasic control segment key from console

Example:

Netfunnel.instance.nfStop(
projectKey: '{{PROJECT_KEY}}',
segmentKey: '{{SEGMENT_KEY}}',
);