22
33import { useEffect , useState } from "react" ;
44import { initializeApp } from "firebase/app" ;
5- import { getRemoteConfig , fetchAndActivate , getAll , setCustomSignals , getString } from "firebase/remote-config" ;
5+ import { getRemoteConfig , fetchAndActivate , getString } from "firebase/remote-config" ;
66import { getInstallations } from "firebase/installations" ;
7- import { getAnalytics , logEvent } from "firebase/analytics" ;
7+ import { getAnalytics } from "firebase/analytics" ;
88
9- function Screen ( { isLoading, summary } = { isLoading : false , summary : "" } ) {
9+ function Screen ( { isLoading, rollout , abt } = { isLoading : false , rollout : "" , abt : "" } ) {
1010 if ( isLoading ) {
11- return ( < div > Loading...</ div > )
11+ return ( < div > Loading...</ div > )
1212 }
1313 return (
1414 < div >
@@ -17,8 +17,9 @@ function Screen({isLoading, summary} = {isLoading: false, summary: ""}) {
1717 </ div >
1818 < br > </ br >
1919 < div >
20- Blurred Summary : { summary }
20+ Rollout value : { rollout }
2121 < br > </ br >
22+ ABT value: { abt }
2223 </ div >
2324 </ div >
2425 )
@@ -28,16 +29,7 @@ export default function Home() {
2829
2930 useEffect ( ( ) => {
3031 const firebaseConfig = {
31- apiKey : process . env . NEXT_PUBLIC_API_KEY ,
32- authDomain : "rc-test-123.firebaseapp.com" ,
33- databaseURL : "https://rc-test-123-default-rtdb.asia-southeast1.firebasedatabase.app" ,
34- projectId : "rc-test-123" ,
35- storageBucket : "rc-test-123.firebasestorage.app" ,
36- messagingSenderId : "985821706564" ,
37- appId : "1:985821706564:web:56b260fbd62e4ad09a7f11" ,
38- measurementId : "G-96PZ0KC1WS"
3932 } ;
40-
4133 console . log ( process . env . API_KEY ) ;
4234
4335 const app = initializeApp ( firebaseConfig ) ;
@@ -46,21 +38,20 @@ export default function Home() {
4638 config . settings . minimumFetchIntervalMillis = 0 ;
4739
4840 const installations = getInstallations ( app ) ;
49-
50- setCustomSignals ( config , { 'test_signal' : 'test' } ) ;
5141
5242 fetchAndActivate ( config ) . then ( success => {
53- console . log ( success , getAll ( config ) ) ;
5443 setIsLoading ( false ) ;
55- setBlurredSummary ( getString ( config , 'show_blurred_summary ' ) ) ;
56- logEvent ( analytics , "test-event" ) ;
44+ setRolloutValue ( getString ( config , 'web_param_rollout ' ) ) ;
45+ setAbtValue ( getString ( config , 'web_param_abt' ) ) ;
5746 } ) ;
5847 } ) ;
5948
6049 const [ isLoading , setIsLoading ] = useState ( true ) ;
61- const [ showBlurredSummary , setBlurredSummary ] = useState ( "blurredSummary" ) ;
50+ const [ showRolloutValue , setRolloutValue ] = useState ( "rolloutValue" ) ;
51+ const [ showAbtValue , setAbtValue ] = useState ( "abtValue" ) ;
52+
6253
6354 return (
64- < Screen isLoading = { isLoading } summary = { showBlurredSummary } > </ Screen >
55+ < Screen isLoading = { isLoading } rollout = { showRolloutValue } abt = { showAbtValue } > </ Screen >
6556 ) ;
6657}
0 commit comments