Skip to content

Commit

Permalink
FLUT-280: Removed flutter_foreground_task from hms_room_kit (#1738)
Browse files Browse the repository at this point in the history
* Removed flutter_foreground_task from hms_room_kit

* 🤖 Automated Format and Fix

* reversed kotlin version

* reversed gradle tools version

* Added namespace in hmssdk_flutter

* Removed old dependencies

* Fixed gradle issues

* Updated podfile

* 🤖 Automated Format and Fix

* updated packages

* 🤖 Automated Format and Fix

---------

Co-authored-by: Decoder07 <[email protected]>
Co-authored-by: Yogesh Singh <[email protected]>
Co-authored-by: ygit <[email protected]>
  • Loading branch information
4 people authored Mar 21, 2024
1 parent 4fc15e7 commit 0c309c2
Show file tree
Hide file tree
Showing 26 changed files with 606 additions and 713 deletions.
6 changes: 0 additions & 6 deletions packages/hms_room_kit/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
PODS:
- Flutter (1.0.0)
- flutter_foreground_task (0.0.1):
- Flutter
- HMSAnalyticsSDK (0.0.2)
- HMSBroadcastExtensionSDK (0.0.9)
- HMSHLSPlayerSDK (0.0.2):
Expand Down Expand Up @@ -30,7 +28,6 @@ PODS:

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_foreground_task (from `.symlinks/plugins/flutter_foreground_task/ios`)
- hmssdk_flutter (from `.symlinks/plugins/hmssdk_flutter/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
Expand All @@ -49,8 +46,6 @@ SPEC REPOS:
EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_foreground_task:
:path: ".symlinks/plugins/flutter_foreground_task/ios"
hmssdk_flutter:
:path: ".symlinks/plugins/hmssdk_flutter/ios"
path_provider_foundation:
Expand All @@ -66,7 +61,6 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
HMSAnalyticsSDK: 4d2a88a729b1eb42f3d25f217c28937ec318a5b7
HMSBroadcastExtensionSDK: d80fe325f6c928bd8e5176290b5a4b7ae15d6fbb
HMSHLSPlayerSDK: 6a54ad4d12f3dc2270d1ecd24019d71282a4f6a3
Expand Down
32 changes: 4 additions & 28 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_foreground_task:
dependency: transitive
description:
name: flutter_foreground_task
sha256: "9bcfcb43bba4a5446a056e723d21118ff6e184926b5557365c32c13caca157c2"
url: "https://pub.dev"
source: hosted
version: "6.1.3"
flutter_linkify:
dependency: transitive
description:
Expand Down Expand Up @@ -402,18 +394,10 @@ packages:
dependency: transitive
description:
name: permission_handler_apple
sha256: "8c90be7f8244eeb2bbfa4248221d38a66ca3e3cc3ab967a25a2529d86eee7c45"
url: "https://pub.dev"
source: hosted
version: "9.4.1"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
version: "9.1.4"
permission_handler_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -482,10 +466,10 @@ packages:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956
sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496"
url: "https://pub.dev"
source: hosted
version: "3.3.1"
version: "3.4.0"
shared_preferences:
dependency: transitive
description:
Expand Down Expand Up @@ -731,14 +715,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.0+2"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: e7d5ecd604e499358c5fe35ee828c0298a320d54455e791e9dcf73486bc8d9f0
url: "https://pub.dev"
source: hosted
version: "14.1.0"
web:
dependency: transitive
description:
Expand Down
20 changes: 0 additions & 20 deletions packages/hms_room_kit/lib/src/common/utility_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:math' as math;

///Package imports
import 'package:flutter/material.dart';
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
Expand Down Expand Up @@ -453,23 +452,4 @@ class Utilities {
return "";
}
}

static void initForegroundTask() {
FlutterForegroundTask.init(
androidNotificationOptions: AndroidNotificationOptions(
channelId: '100ms_flutter_notification',
channelName: '100ms Flutter Notification',
channelDescription:
'This notification appears when the foreground service is running.',
channelImportance: NotificationChannelImportance.LOW,
priority: NotificationPriority.LOW,
iconData: const NotificationIconData(
resType: ResourceType.mipmap,
resPrefix: ResourcePrefix.ic,
name: 'launcher',
)),
iosNotificationOptions:
const IOSNotificationOptions(showNotification: false),
foregroundTaskOptions: const ForegroundTaskOptions());
}
}
662 changes: 319 additions & 343 deletions packages/hms_room_kit/lib/src/meeting/meeting_page.dart

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'dart:io';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
import 'package:intl/intl.dart';

//Project imports
Expand Down Expand Up @@ -839,6 +838,7 @@ class MeetingStore extends ChangeNotifier
room.hmshlsStreamingState?.state ?? HMSStreamingState.none;

setParticipantsList(roles);
toggleAlwaysScreenOn();
for (HMSPeer each in room.peers!) {
if (each.isLocal) {
int index = peerTracks
Expand Down Expand Up @@ -942,12 +942,6 @@ class MeetingStore extends ChangeNotifier
});
}

void initForegroundTask() {
FlutterForegroundTask.startService(
notificationTitle: "100ms foreground service running",
notificationText: "Tap to return to the app");
}

void getSpotlightPeer() async {
String? metadata =
await _hmsSessionStore?.getSessionMetadataForKey(key: "spotlight");
Expand Down Expand Up @@ -1366,7 +1360,6 @@ class MeetingStore extends ChangeNotifier

void resetForegroundTaskAndOrientation() {
setLandscapeLock(false);
FlutterForegroundTask.stopService();
}

// void clearPIPState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class _MeetingScreenControllerState extends State<MeetingScreenController> {
null) {
_setHLSPlayerStore();
}
Utilities.initForegroundTask();
}

///This function joins the room only if the name is not empty
Expand Down
1 change: 0 additions & 1 deletion packages/hms_room_kit/lib/src/preview/preview_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ class PreviewStore extends ChangeNotifier
Constant.onLeave!();
}
HMSThemeColors.resetLayoutColors();
hmsSDKInteractor.toggleAlwaysScreenOn();
destroy();
}

Expand Down
32 changes: 4 additions & 28 deletions packages/hms_room_kit/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_foreground_task:
dependency: "direct main"
description:
name: flutter_foreground_task
sha256: "9bcfcb43bba4a5446a056e723d21118ff6e184926b5557365c32c13caca157c2"
url: "https://pub.dev"
source: hosted
version: "6.1.3"
flutter_linkify:
dependency: "direct main"
description:
Expand Down Expand Up @@ -379,18 +371,10 @@ packages:
dependency: transitive
description:
name: permission_handler_apple
sha256: "8c90be7f8244eeb2bbfa4248221d38a66ca3e3cc3ab967a25a2529d86eee7c45"
url: "https://pub.dev"
source: hosted
version: "9.4.1"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
version: "9.1.4"
permission_handler_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -459,10 +443,10 @@ packages:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956
sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496"
url: "https://pub.dev"
source: hosted
version: "3.3.1"
version: "3.4.0"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -708,14 +692,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.0+2"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: e7d5ecd604e499358c5fe35ee828c0298a320d54455e791e9dcf73486bc8d9f0
url: "https://pub.dev"
source: hosted
version: "14.1.0"
web:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion packages/hms_room_kit/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies:
tuple: ^2.0.2
url_launcher: ^6.1.11
share_plus: ^7.0.2
flutter_foreground_task: ^6.1.2
collection: ^1.17.0
dots_indicator: ^3.0.0

Expand Down
6 changes: 6 additions & 0 deletions packages/hmssdk_flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {

namespace 'live.hms.hmssdk_flutter'
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand Down
4 changes: 2 additions & 2 deletions packages/hmssdk_flutter/example/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.898.0)
aws-partitions (1.899.0)
aws-sdk-core (3.191.4)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand All @@ -24,7 +24,7 @@ GEM
aws-sdk-kms (1.78.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.145.0)
aws-sdk-s3 (1.146.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
Expand Down
12 changes: 8 additions & 4 deletions packages/hmssdk_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}


defaultConfig {
applicationId "live.hms.flutter"
minSdkVersion 21
Expand Down Expand Up @@ -60,12 +65,11 @@ android {
}
lint {
checkDependencies true
abortOnError false
}
android.buildTypes.release.ndk.debugSymbolLevel "FULL"

lintOptions {
abortOnError false
}
namespace 'live.hms.flutter'
}

flutter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="live.hms.flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="live.hms.flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<queries>
<!-- If your app opens https URLs -->
Expand Down Expand Up @@ -73,10 +72,6 @@
android:scheme="https" />
</intent-filter>
</activity>
<service android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="camera|microphone"
android:stopWithTask="true"
exported="false" />

<!--Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new com.llfbandit.app_links.AppLinksPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin app_links, com.llfbandit.app_links.AppLinksPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin());
} catch (Exception e) {
Expand All @@ -36,14 +41,14 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
Log.e(TAG, "Error registering plugin firebase_performance, io.flutter.plugins.firebase.performance.FlutterFirebasePerformancePlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.pravera.flutter_foreground_task.FlutterForegroundTaskPlugin());
flutterEngine.getPlugins().add(new live.hms.hmssdk_flutter.HmssdkFlutterPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_foreground_task, com.pravera.flutter_foreground_task.FlutterForegroundTaskPlugin", e);
Log.e(TAG, "Error registering plugin hmssdk_flutter, live.hms.hmssdk_flutter.HmssdkFlutterPlugin", e);
}
try {
flutterEngine.getPlugins().add(new live.hms.hmssdk_flutter.HmssdkFlutterPlugin());
flutterEngine.getPlugins().add(new dev.steenbakker.mobile_scanner.MobileScannerPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin hmssdk_flutter, live.hms.hmssdk_flutter.HmssdkFlutterPlugin", e);
Log.e(TAG, "Error registering plugin mobile_scanner, dev.steenbakker.mobile_scanner.MobileScannerPlugin", e);
}
try {
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
Expand All @@ -60,11 +65,6 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin permission_handler_android, com.baseflow.permissionhandler.PermissionHandlerPlugin", e);
}
try {
flutterEngine.getPlugins().add(new net.touchcapture.qr.flutterqr.FlutterQrPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin qr_code_scanner, net.touchcapture.qr.flutterqr.FlutterQrPlugin", e);
}
try {
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.share.SharePlusPlugin());
} catch (Exception e) {
Expand All @@ -75,11 +75,6 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e);
}
try {
flutterEngine.getPlugins().add(new name.avioli.unilinks.UniLinksPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin uni_links, name.avioli.unilinks.UniLinksPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
} catch (Exception e) {
Expand Down
Loading

0 comments on commit 0c309c2

Please sign in to comment.