|
- {"identifier":{"url":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/checkAndSendData()","interfaceLanguage":"swift"},"schemaVersion":{"minor":3,"patch":0,"major":0},"primaryContentSections":[{"declarations":[{"platforms":["iOS"],"tokens":[{"text":"@","kind":"attribute"},{"preciseIdentifier":"s:ScM","text":"MainActor","kind":"attribute"},{"text":" ","kind":"text"},{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"text":"checkAndSendData","kind":"identifier"},{"text":"() ","kind":"text"},{"kind":"keyword","text":"async"},{"kind":"text","text":" -> "},{"preciseIdentifier":"s:Sb","kind":"typeIdentifier","text":"Bool"}],"languages":["swift"]}],"kind":"declarations"},{"kind":"content","content":[{"text":"Return Value","anchor":"return-value","type":"heading","level":2},{"inlineContent":[{"type":"text","text":"A boolean indicating whether data was sent successfully."}],"type":"paragraph"}]},{"kind":"content","content":[{"type":"heading","anchor":"discussion","level":2,"text":"Discussion"},{"type":"codeListing","syntax":"swift","code":["func checkAndSendData() async -> Bool {"," await delay(seconds: 2)"," closeControllerWiFi(ssid: ssid)"," await delay(seconds: 4)",""," let isConnected = await checkInternetConnectivity()"," if isConnected {"," Task {"," _ = await sendToServer()"," }"," if isDataSendToServerTestVariable {"," return true"," } else {"," return false"," }"," } else {"," self.alertTitle = \"No Internet Connection\""," self.alertMessage = \"Unable to send data. Please check your internet connection and try again.\""," self.isShowingAlert = true"," return false"," }","}"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/fueling\/coredatamanager\/checkandsenddata()"]}],"metadata":{"fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"checkAndSendData","kind":"identifier"},{"kind":"text","text":"() "},{"kind":"keyword","text":"async"},{"kind":"text","text":" -> "},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"title":"checkAndSendData()","symbolKind":"method","externalID":"s:7Fueling15CoreDataManagerC012checkAndSendC0SbyYaF","modules":[{"name":"Fueling"}],"role":"symbol","roleHeading":"Instance Method"},"abstract":[{"type":"text","text":"Checks internet connectivity and sends data if connected."}],"kind":"symbol","sections":[],"hierarchy":{"paths":[["doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager"]]},"references":{"doc://rpm.com.production.Scanner/documentation/Fueling/CoreDataManager":{"fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"text":"CoreDataManager","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager","kind":"symbol","title":"CoreDataManager","abstract":[],"navigatorTitle":[{"text":"CoreDataManager","kind":"identifier"}],"url":"\/documentation\/fueling\/coredatamanager","role":"symbol"},"doc://rpm.com.production.Scanner/documentation/Fueling":{"kind":"symbol","url":"\/documentation\/fueling","title":"Fueling","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","abstract":[{"type":"text","text":"The Scanner app is designed to facilitate secure and efficient fuel management operations, primarily focusing on user authentication, fuel data collection, and network communication. The app includes several key features to ensure seamless and reliable interactions between users and the backend systems, leveraging technologies like WebSockets, Core Data, and biometric authentication."}],"type":"topic","role":"collection"},"doc://rpm.com.production.Scanner/documentation/Fueling/CoreDataManager/checkAndSendData()":{"url":"\/documentation\/fueling\/coredatamanager\/checkandsenddata()","fragments":[{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"checkAndSendData"},{"kind":"text","text":"() "},{"text":"async","kind":"keyword"},{"text":" -> ","kind":"text"},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"title":"checkAndSendData()","kind":"symbol","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/checkAndSendData()","type":"topic","role":"symbol","abstract":[{"type":"text","text":"Checks internet connectivity and sends data if connected."}]}}}
|