I have a button in my app to make a telephone call, and I need to returen to my app after call is finished.
Is there any way to do this?
Can't be done. The user will have to open your app themselves.
If you mean that the user can make a phone call to another user, starting from your application, which closes said application, then what you are asking is simply impossible. The best you can do is have the application get into suspended mode. The user will need to get it back from the tray.
If for some reason your application has a button that calls the user (possibly by triggering some external server), then you should edit your question to be clearer... however, the user still needs to get your application back himself from suspended state.
Related
I am building a chat app in Flutter Web, and would like to add a feature for flagging when the user is "Online".
I want to send a bool to Firebase Firestore whenever the user launches and closes the app (for example, when the user launches the Flutter Web URL = true is being sent to Firestore for isOnline flag. And when the user closes the tap = false is being sent to isOnline).
For that, I would need a way to detect the lifecycle of the Flutter Web app, and to check whether the app is currently actively running or not.
Does anyone know what is the best way of doing that?
Thank you!
While you can easily update your firestore whenever a user opens your app (just add it to a point executed on launch, like before the runApp() part in your main method). However, there sadly is no guaranteed way to know, if a user closes your app. It could be force closed via task manager etc., robbing you of the ability to detect it. However, firebase offers the following solution to detect presence, see here.
You could also save a timestamp as the isOnline point and let it timeout. You could update it periodically in your app, giving you not a perfect but maybe a good enough idea if a user is online.
I'm trying to track when a user's app is about to terminate and send something to firebase when it happens. I looked through the Offline Capabilities documentation and tried using ".info/connected" as well as .onDisconnectSetValue().
I've had success with .onDisconnectSetValue(), but if the iPhone's side button is pressed and the iPhone goes to sleep, it fires and says the user is inactive (and I can't set another value until the user brings the app to the foreground again).
I tried moving .onDisconnectSetValue() to applicationWillTerminate() so it only catches terminations but it doesn't fire when I close the app (I assume because it can't in time)
Is there anything with Firebase that could set a value with the specific instance of the user closing the app?
The Firebase client can detect whether the app is online, with .info/connected and the app can tell the server to perform a specific write once it has gone offline with onDisconnect.
Firebase has no built in functionality for writing to the database when the user is about to close the app. That's something you're more likely to find on the iOS level, such as shown in iOS - detect when application exits and Which Event When i close app in iOS?. Typical lifecycle events on iOS are applicationWillTerminate, and applicationWillResignActive.
I'm currently working on an iPhone app that requires the user to accept a terms of use/disclaimer. If the user does not accept the disclaimer, I would like the app to close.
It is my understanding that exit(0); is frowned upon (as discussed at Proper way to exit iPhone application?) and the Human Interface Guidelines state that the only time an application should close is via user intervention.
What is the best practice for stopping the functionality of my app if the user presses a 'Reject' button for the disclaimer?
Should exit(0); be called, or is there a more graceful way to close the app? I'm not necessarily worried about removing the app from memory -- I'm just wanting the app to kick the user back to the home screen.
Does the user pressing a 'Reject' button constitute user intervention, consistent with the Human Interface Guidelines?
The correct way to handle this would be to write your terms into the EULA that goes along with your application. The gatekeeper then becomes the App Store, and this problem goes away. You can then assume that anyone running your app has agreed to the terms.
Apple provides a standard EULA, but your laywers can supply you with a custom one. Apple just has a few requirements that that custom EULA's terms must meet.
In my opinion, the best thing to do after user taps "reject" is to give him a sorry message without any button to proceed. In other words, the user will have nothing to do without pressing the home button. It's better than exit(0) as that looks like a crash.
In my case I had a message at the beginning of my app stating that some amount of data should be downloaded before continuing, with two buttons to "Continue" or "Exit" the app. The "Exit" button didn't really exit but just bring to front the Safari browser to show our home page.
And this app got rejected by the App Store reviewers just because of that Exit button. The funny thing is they rejected the app when submitting my second update to the original version! (the two previous versions had been approved just fine and had that very same "Exit" button).
Anyway, it seems it's important not to exit your app in any way.
Your app will almost certainly be rejected if you force it to quit programatically. You should simply present a pop-up informing the user they cannot use the app unless they accept the disclaimer, and ask them to press the Home button to exit. Basically, don't kick the user out of the app at any point. Let them decide when to leave.
The iPhone app I'm writing has an option in the SETTING page: "ask for password when launching this app". (As a security measure.)
If the user types in the correct password... the app runs.
If the user types in the wrong password... the app needs to immediately exit.
There isn't any kind of "immediately exit this app" in any framework (that I can find).
What is the app-store legal way to do this?
http://developer.apple.com/library/ios/#qa/qa2008/qa1561.html
There is no API provided for gracefully terminating an iPhone application. Under the iPhone OS, the user presses the Home button to close applications. Should your application have conditions in which it cannot provide its intended function, the recommended approach is to display an alert for the user that indicates the nature of the problem and possible actions the user could take - turning on WiFi, enabling Location Services, etc. Allow the user to terminate the application at their own discretion.
Just display a screen that says "The password you entered is invalid." Not sure why you wouldn't allow them to try again, though - I'd find being made to relaunch the app each time I make a typo quite frustrating.
There is none. Applications are not supposed to exit. What you can do, however, is what an application I wrote that needed network access does: present a UIAlertView with no buttons so that the user is forced to quit the app (press the home screen button).
Just keep in mind that with iOS 4.0 and multitasking, you’ll have to give the user another opportunity to enter the password if the application is put into the background and then restarted.
You can use
exit(0);
although not recommended as explained by others.
I read more post regarding iPhone notification, and I have a simple question....
Where a device receive a notification (so I can display a message contains the message notificatio ti advise the user).
I understand that message is managed by the application.
The question is:
...when my application receive the notification is it possible to start it?
Or in other world the application became run when receive the notification or it simple became active only to manage the message and at the end of notification management the app return to sleep?
The main application windows is opened on the device ?
Many thanks in advance
Lukenukem
Ciao
With push notifications you can prompt the user to take action, which if they agree (by tapping the "open application" button), will open the application automatically.
The caveat is that you can't do this without the users consent. They have to tap the open application button for your app to open. There's no way to open the app automatically without the user's action, nor is there any way to open, perform the required actions and quit the app automatically.
The apps dont "sleep" they are either running or not (till 4.0 OS that is), im assuming you are asking about push notification, what happens when a user receives a notification is that they can choose to close it, or go ahead and "view" the notification which can cause the app to open automatically...thats as far is it goes in the current system i blive...