importFirebaseConstantsfrom"./FirebaseConstants";import{Alert}from"react-native";constAPI_URL="https://fcm.googleapis.com/fcm/send";classFirebaseClient{asyncsend(body,type){if(FirebaseClient.KEY==='YOUR_API_KEY'){Alert.alert('Set your API_KEY in app/FirebaseConstants.js')return;}letheaders=newHeaders({"Content-Type":"application/json","Authorization":"key="+FirebaseConstants.KEY});try{letresponse=awaitfetch(API_URL,{method:"POST",headers,body});console.log(response);try{response=awaitresponse.json();if(!response.success){Alert.alert('Failed to send notification, check error log')}}catch(err){Alert.alert('Failed to send notification, check error log')}}catch(err){Alert.alert(err&&err.message)}}}letfirebaseClient=newFirebaseClient();exportdefaultfirebaseClient;