File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 <category android : name =" android.intent.category.LAUNCHER" />
3030 </intent-filter >
3131 </activity >
32- <service android : name =" com.voximplant.foregroundservice.VIForegroundService"
33- android : foregroundServiceType =" mediaProjection" />
32+ <meta-data
33+ android : name =" com.supersami.foregroundservice.notification_channel_name"
34+ android : value =" Call"
35+ />
36+ <meta-data
37+ android : name =" com.supersami.foregroundservice.notification_channel_description"
38+ android : value =" "
39+ />
40+ <service android : name =" com.supersami.foregroundservice.ForegroundService"
41+ android : foregroundServiceType =" mediaProjection" />
42+ <service android : name =" com.supersami.foregroundservice.ForegroundServiceTask" />
43+ <service android : name =" com.voximplant.foregroundservice.VIForegroundService" />
3444 </application >
3545
3646</manifest >
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ import { name as appName } from './app.json';
44import { registerGlobals } from '@livekit/react-native' ;
55import { LogLevel , setLogLevel } from 'livekit-client' ;
66import { setJSExceptionHandler } from 'react-native-exception-handler' ;
7+ import ReactNativeForegroundService from '@supersami/rn-foreground-service' ;
78setJSExceptionHandler ( ( error ) => {
89 console . log ( 'error:' , error , error . stack ) ;
910} , true ) ;
1011
1112setLogLevel ( LogLevel . debug ) ;
1213registerGlobals ( ) ;
14+ ReactNativeForegroundService . register ( ) ;
1315AppRegistry . registerComponent ( appName , ( ) => App ) ;
Original file line number Diff line number Diff line change 1313 "@react-native-async-storage/async-storage" : " ^1.17.10" ,
1414 "@react-navigation/native" : " ^6.0.8" ,
1515 "@react-navigation/native-stack" : " ^6.5.0" ,
16- "@voximplant/react-native- foreground-service" : " ^3.0.1 " ,
16+ "@supersami/rn- foreground-service" : " ^2.1.0 " ,
1717 "fastestsmallesttextencoderdecoder" : " ^1.0.22" ,
1818 "react" : " 18.2.0" ,
1919 "react-native" : " 0.71.8" ,
Original file line number Diff line number Diff line change 1- import VIForegroundService from '@voximplant/react-native -foreground-service' ;
1+ import ReactNativeForegroundService from '@supersami/rn -foreground-service' ;
22
33// Start a foreground notification on Android.
44// A foreground notification is required for screenshare on Android.
55export async function startCallService ( ) {
6- const channelConfig = {
7- id : 'channelId' ,
8- name : 'Call' ,
9- description : '' ,
10- enableVibration : false ,
11- } ;
12- await VIForegroundService . getInstance ( ) . createNotificationChannel (
13- channelConfig
14- ) ;
15- const notificationConfig = {
16- channelId : 'channelId' ,
6+ await ReactNativeForegroundService . start ( {
177 id : 3456 ,
188 title : 'LiveKit React Example' ,
19- text : 'Call in progress' ,
9+ message : 'Call in progress' ,
10+ importance : 'none' ,
11+ vibration : false ,
2012 icon : 'ic_launcher' ,
21- } ;
22- try {
23- await VIForegroundService . getInstance ( ) . startService ( notificationConfig ) ;
24- } catch ( e ) {
25- console . error ( e ) ;
26- }
13+ } ) ;
2714}
2815export async function stopCallService ( ) {
29- await VIForegroundService . getInstance ( ) . stopService ( ) ;
16+ await ReactNativeForegroundService . stop ( ) ;
3017}
Original file line number Diff line number Diff line change 20242024 dependencies :
20252025 " @sinonjs/commons" " ^3.0.0"
20262026
2027+ " @supersami/rn-foreground-service@^2.1.0 " :
2028+ version "2.1.0"
2029+ resolved "https://registry.yarnpkg.com/@supersami/rn-foreground-service/-/rn-foreground-service-2.1.0.tgz#890d82778676651899be8d7aed72640242af2193"
2030+ integrity sha512-Ou++vMcW42uZDuZr7wWMJYKZL7Ui1Z5lfY5fg7LT2vVwuuDNjjFf4RCHxul9y33VcoQrPTyPJhd0jQ3+3kFi8w==
2031+
20272032" @types/fastestsmallesttextencoderdecoder@^1.0.0 " :
20282033 version "1.0.0"
20292034 resolved "https://registry.yarnpkg.com/@types/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.0.tgz#24477652ac71737558fdf54ee0ab17385bd653b5"
21102115 dependencies :
21112116 " @types/yargs-parser" " *"
21122117
2113- " @voximplant/react-native-foreground-service@^3.0.1 " :
2114- version "3.0.1"
2115- resolved "https://registry.yarnpkg.com/@voximplant/react-native-foreground-service/-/react-native-foreground-service-3.0.1.tgz#e96d102d060b15c303558ecac9846345d22f7410"
2116- integrity sha512-lCjNe89KcOuTxe8i+XKAMoWhHqeLQr9dAYprLNum/VyZgDOUhmz3tRdQ86lXs9M37oXTe0VkEd22oVCdtMIQpw==
2117-
21182118abort-controller@^3.0.0 :
21192119 version "3.0.0"
21202120 resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
Original file line number Diff line number Diff line change 7373 "typescript" : " 4.8.4"
7474 },
7575 "peerDependencies" : {
76+ "@livekit/react-native-webrtc" : " ^104.0.0" ,
7677 "react" : " *" ,
77- "react-native" : " *" ,
78- "@livekit/react-native-webrtc" : " ^104.0.0"
78+ "react-native" : " *"
7979 },
8080 "scripts" : {
8181 "test" : " jest" ,
9898 "commitlint" : {
9999 "extends" : [
100100 " @commitlint/config-conventional"
101- ]
101+ ],
102+ "rules" : {
103+ "type-enum" : [
104+ 2 ,
105+ " always" ,
106+ [
107+ " build" ,
108+ " chore" ,
109+ " ci" ,
110+ " docs" ,
111+ " feat" ,
112+ " fix" ,
113+ " perf" ,
114+ " refactor" ,
115+ " revert" ,
116+ " style" ,
117+ " test" ,
118+ " example"
119+ ]
120+ ]
121+ }
102122 },
103123 "release-it" : {
104124 "hooks" : {
You can’t perform that action at this time.
0 commit comments