Skip to main content

Example

Pitel UI Kit Demo

pitel_ui_kit is demo project. Check out from pitel_ui_kit.

Installation

Note Pitel UI Kit requires flutter version 3.24.2, dart version 3.5.2

  • Setup to wake up app: please follow guide in here to setting push notification (FCM for android), Pushkit (for IOS).
  • In file firebase_options.dart, fill information from your google_service.json
  // Replace information from your google_service.json
static const FirebaseOptions android = FirebaseOptions(
apiKey: '${apiKey}',
appId: '${appId}',
messagingSenderId: '${messagingSenderId}',
projectId: '${projectId}',
storageBucket: '${storageBucket}',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: '${apiKey}',
appId: '${appId}',
messagingSenderId: '${messagingSenderId}',
projectId: '${projectId}',
storageBucket: '${storageBucket}',
iosClientId: '${iosClientId}',
iosBundleId: '${iosBundleId}',
);
  • Replace com.pitel.uikit.demo with your bundleId/ packageId in
    • IOS: Open Xcode -> Signing & Capabilities -> Select Team & Replace your bundleId in field Bundle Identifier
    • Android: In file android/app/build.gradle. Replace com.pitel.uikit.demo with your packageId
defaultConfig {
applicationId "com.pitel.uikit.demo" // Replace your packageId
minSdkVersion flutterMinSdkVersion.toString()
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
  • In file app.dart fill sip info data
final sipInfoData = SipInfoData.fromJson({
"authPass": "${Password}",
"registerServer": "${Domain}",
"outboundServer": "${Outbound Proxy}",
"port": PORT,
"accountName": "${UUser}", // Example 101
"displayName": "${Display name}",
"wssUrl": "${URL WSS}",
"apiDomain": "${URL API}"
});
  • In file app.dart fill sip info data
  final PushNotifParams pushNotifParams = PushNotifParams(
teamId: '${apple_team_id}',
bundleId: '${bundle_id}',
);

pitelService.setExtensionInfo(sipInfoData, pushNotifParams);
  • Get device token from function (to test notification)
await PushVoipNotif.getDeviceToken();
  • Get package
flutter pub get
  • Run source code
flutter run