FB app connected to server to check software version

I developed a mobile application using FB 4.6 however, I’m stuck in doing the below:

Application Use – After 1st Installation/ Update
• Time Stamp Check: The application is required to verify if it has the most up to date version by checking a configuration file on a server. The following operations occurs in each scenario.
Internet Connection Available
􀂃 Check <24 Hours: If less than 24 hours since last check, ignore and proceed. This ensures the app only connects to the server once per day, and minimizes latency and data traffic.
􀂃 If more than 24 hours passed, check for minimum version from server.
• Compare minimum version values, and if exceeded show the custom error message informing the user they must update within 30 days to the date in which the update became available.
• If 30 days has passed since the update became available, the user is shown a “dead-end view” with no OK buttons, effectively rendering the app unusable. The user has to manually update this app through respective apps store to be able to use it again. This view details the reason for the disable and that they must update to continue using the app. This message is delivered via the linked server to the device.
No Internet Connections
􀂃 If less than 30 days since last server check, the app works in offline mode
􀂃 If more than 30 days have passed, the user is shown a message requiring them to go online and check for a minimum version
• User can use all the app’s features as listed in section 2.1, assuming they did not have their app disabled as outlined by the process above.
I’d appreciate your help.