this question is duplicate but still i need help on this question because i use one of VPN app that app shows an alert if i close the app while connecting to the server, i'm also need to do same type of work while i'm connected to server in app. i need to restrict the user to keep the app open if user press home button then need to notify user to keep open the app for his online status.
for iPhone, you can't forbid user press home button.
Maybe if you app enter background, you can push a local notification, notify user, keep your app online. I think this is a good idea. 😆
Related
I don't understand the difference between closing an app and killing it from the user point if view.
As far as I know if I want to close an app I will proceed like explained here https://support.apple.com/en-us/HT201330
But if I want to kill the app, how me, as a user, can do this? I know for android if you search in settings for that app there is a button called force stop.
I ask this because I want to use silent notifications and don't know what they mean here:
If something force quits or kills the app, the system discards the held notification. It's taken from this page:
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app
I want to develop an app, but before I actually start developing, I've been doing some research so that i can be sure it's going to work in the way I'd like to do this.
You can imagine the app as a kind of news app, where the user can indicate whether he wants to receive push notifications, and may also indicate that he only wants to receive a push notification if it is in X distance from his current location.
And this is probally a problem on IOS, On android it would be no problem if a push notification came in to read the current position of the user and settings and then show the push notification or not.
As far as I've read this is a problem on iOS, the system receives the push and the app can not respond to it unless the user clicks on it.
Theres also another problem about closing an app on IOS, ideally a app should not be closed (swiped out) by the user because this would be a force close on IOS.
From ive seen most users still swipe out apps, and this would mean that my app cannot run background tasks anymore.
This is what i thougt about:
Send Silent push, app download data on the background -> Check if this meets the user settings, if so show a local notification. (30 sec time to handle, but do not know if it is possible to throw a local push here too.)
The app sends data on the background over the user's current position before sending a push, the server checks for which apps it should be sent (actually no solution, too much data usage as it may be that the user is only one Specific location, need a good server if the app is used on thousands of devices.).
Does anyone have any idea how to handle this problem?
I'm developing an app with Core Bluetooth in objective-c. And I have a question. If the user close the app or presh home button and this go to background, could my app turn open when my device send a signal by bluetooth?
Is this possible?
You can show a notification to the user and the user can then decide to open your application. You can't force the app to be opened automatically, without user's consent.
That's actually the whole point of notifications - bring the user's attention to something that is happening in your app.
When handling inApp purchase (using Parse.com) in an iOS app, the user clicks BUY and waits for the iTunes login (or enter password) prompt to come up.
During the waiting time, I display and activityView to ask the user to wait.
Then when the prompt shows up, I need to clean this activityView.
What is the call back function I need to put the code into?
Is there something like loginPromptDidAppear? From which I could clean off the activityView.
As the prompt is issued by iOS, not your app, you will get a call to the applicationWillResignActive method in your app delegate, just as you would if a phone call is received.
You should be able to track your app operation (i.e. purchase initiated) and react accordingly when your app resigns active state.
One of our clients asked for this functionality: "Permanently display a message (or image) on the iPhone lockscreen".
Our initial ideas were:
Changing the device lockscreen image:
Couldn't find a solution for doing this. Couldn't find even a private API for it.
Playing an audio in background and display an album artwork. It has a few problems:
We cannot hide the volume and track buttons
Display a notification:
The notification will go away after the user skips the lockscreen
Any ideea how we can accomplish this request. Please note that the app is NOT intended to be distributed via AppStore. This is an internal app only. It should work on NON-Jailbreak devices through. The app will be enterprise distribuited.
Kind regards,
Artwork
If it's not intended for the app store, you could definitely use the artwork thing. Since you don't need to comply with the iOS guidelines, just warn your users that the lockscreen buttons won't work if you try using them. This link and this one should help.
Using the iOS 7 background fetch can help you manage messages display, as long as the app has already been opened once. To know if the app is opened, you can send ping to your server saving the current app state every X minutes. If the server doesn't receive an update, it will just guess that the app is not running, he'll send emails or push notifications to the user until he does so.
Issues:
If the user opens an app like Music or any other that can become a responder, it will override your message.
You can only display a message if the app is opened at least once.
Remote notifications
It could be a good option since a notification can stay on the lockscreen as long as the user or you doesn't clear the notification center (you have to set it). And you can remotely display any message without the app being launched.
Issues:
You have no way of knowing if he cleared the notification. An idea would be to send them an email if notifications have been disabled.
Users can just disable notifications.
Lockscreen image
You won't be able to change the device lockscreen image without a jailbroken device.
I'd go with the first one, if it's a client requirement it seems like a reliable one. It all depends on how much control they have on the devices.