promptbet_sdk 1.2.7 copy "promptbet_sdk: ^1.2.7" to clipboard
promptbet_sdk: ^1.2.7 copied to clipboard

PromptBet SDK for Flutter

PromptBet SDK for Flutter

Add Android Permissions: #

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Environment #

Use initializeV2 with a token and pass the desired environment so the SDK talks to the matching API and WebView hosts. The method returns InitializationStatus { HEALTHY, UNAVAILABLE, INVALID_TOKEN }. Launch only when HELATHY.


final sdk = PromptbetSdk();
final status = await sdk.initializeV2(
  yourToken,
  (event) { /* handle events for close, bet, ... */ },
  params: { 'environment': 'production' }, // 'dev' | 'staging' | 'production'
);
if (status == InitializationStatus.HEALTHY) {
  await sdk.launch(context);
}

Add iOS Permissions: #

<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for recording audio</string>

Add iOS Podfile extension: #

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
            '$(inherited)',
            'PERMISSION_MICROPHONE=1',
          ]
        end
    end
end