Get notifications even if using Android Wear Application - notifications

Is it possible to get notification in Android wear if wear specific application is running in Android wear device. I noticed that I got notified only after existing my wear application.
Another problem I faced is, If one reads a notification and if another notification comes, it just closed the current notification and opened the recent notification.
Is that the way Android wear actually works? or am I wrong somewhere ?

For the first question : you are notified, the device vibrates, but since your Wear application is in full screen and notifications are only displayed on the watch face, you can't see them/interact with them while you are on the application.
For the second one : it's the way the Card stream works, if you receive a notification while reading another, once you cancel the second one, the new notification will pop up, being at the top of your stream.

Related

iBeacon entry.exit callback when app is force killed by swipe up iOS

I read in many places that if user swipes up and kills an app, that app will not be able to receive location updates. I get didEnterRegion and didExitRegion callbacks are received when my app is not killed and is in background. But if I swipe kill app, app doesn't get those callbacks. My question here is,
Is it that app will stop getting callbacks ever? i.e., even if the app is launched again and is in background it does not get the callbacks
I read about startMonitoringSignificantLocationChanges and background app refresh when used together, I can get callback even when app is killed by swipe. I tried this and could not get it working. Is this the expected behavior?
Will startMonitoringSignificantLocationChanges and background app refresh together when used, I get region entry/exit callbacks after rebooting device?
This is not expected behavior. You are supposed to get didEnterRegion and didExitRegion callbacks even after killing an app in the task switcher. If you are not seeing this, something may be wrong with your app or testing methodology. Posting code may be helpful.
A few caveats and tips:
Make sure your app has obtained backround permission with locationManager.requestAlwaysAuthorization(). Without it, it cannot detect at all in the background.
Detection in the killed state did not work on iOS 7.0.x. It started working as of 7.1+.
Make sure you wait long enough to get detections. In some app states, it can take up to 15 minutes.
Before killing your app in testing, check logs to ensure you know what CoreLocation thinks is your current region state. If you turn off a beacon then kill your app, CoreLocation may not have had time to realize the beacon disappeared, thinking it is still inside the region. If you then turn on the beacon, you will not get a new entry event because it thinks you are already inside.

Background modes are turned off automatically

I have set in the Info.plist, the "app require background modes", the "app registers for location updates".
I put the app to be in the background, and I do get the location delegates for a while, but after 25 minutes it stopped getting the locations.
How do I know that? Each call of the delegate, it sends the data to the server (parse) .
I am also wondering if the problem arises because the location is turned off in the background, or because I can't send data to the server at background.
Also do I have to turn on audio to keep it alive?
According to Apple, I can listen in the background with:
apps that play audible content to the user while in the background, such as a music player app
apps that record audio content while in the background
apps that keep users informed of their location at all times, such as a navigation app
apps that support Voice over Internet Protocol (VoIP)
apps that need to download and process new content regularly
apps that receive regular updates from external accessories
Do I have to turn on an audio? Our app needs to get data location constantly from business.
This issue is amazing. There are dozens of opinions about what you can do and what you can't do. There is no one place that tells you how you can sample background locations, and if Apple allows this.
I guess problem is with pausesLocationUpdatesAutomaticallyBy
By default LocationManager pausesLocationUpdatesAutomatically is Yes, so after some if your device is not move or not change location may OS will stop the app, so set NO for this property , and not need to turn on an audio.

geofencing no longer relaunch app from terminated state in ios7?

I'm developing an app which uses ibeacon to determine if the user entered a specific region.
Now I'm using the CoreLocation framework to implement this geofencing-based feature.
I've read the document below.
https://developer.apple.com/library/mac/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html
in which the Apple is saying that:
"In iOS, the regions you register with the location manager persist between launches of your application. If a region crossing occurs while your iOS app is not running, the system automatically wakes it up (or relaunches it) in the background so that it can process the event. When relaunched, all of the regions you configured previously are made available in the monitoredRegions property of any location manager objects you create. "
I discovered that it's true just before the ios 7.
From ios 7, An app will be waken-up from background but it will actually no longer could be re-launched from terminated-state (slided out from the task manager which displayed by double-clicking the home button).
If it's due to the Apple's policies, why does Apple not update the above official document?
So I'm thinking of an ios7's bug because the Reminder App (a built-in app) is also not relaunched in ios7 even though it's relaunched in ios6.
Is this issue due to Apple's policies? or an ios7's bugs?
It takes me more than 2 days to google for a solution.
Any ideas for this issue?
The documentation is simply out of date. This is intended behavior in iOS7. Apple produced a video explicitly discussing this change. The idea is that if the user explicitly terminates the app, the user does not want it running. See this thread.
Is this such a big deal? How often will users really do this? Remember, if users are annoyed by you app, they can always uninstall it, too. This was true in iOS6.
iOS 7.1 reversed this policy. That is even if the user kills your app the iOS still launches your app upon crossing the region.

Save Button Pushes and Location

I am making an app where I need to know
every button that was ever pushed by the user in the app, and when it was pushed, and
where the iPhone has gone (using gps), but there are no cell towers in the area so I can't use that significant location changes method everyone uses.
It seems to me like the Plist method for data saving won't work because I don't want the app to start where it left off, I want it to start at the beginning every time.
Also, if any of you have any idea how I can make my app wake up at certain specific times, and/or how I can make it impossible to exit, that would be awesome. This is for an experiment with the University of Queensland St. Lucio Psych Department and the Grute Eylandt Aborigines.
You can know everything the user does in your app if you want. You could use your own solution with an SQLite database for example, and dispatch the data to a server every once in a while.
The GPS is also easy, you could just track the user with the Core Location framework.
You can't make the app wake at specific times, the best you can do is implement push notifications but it's up to the user to open the app via the notification or by themselves by tapping the app icon on the iPhone home screen.
Otherwise you could set up a local notification just before exiting the application, this is faster and easier to implement then setting up push notifications.
There is also no way to stop the app being closed, that is until iOS 6 comes along with it's accessibility features, you can disable the home button then. But not now.

UIApplicationWillEnterForegroundNotification is not called when app is briefly closed

The UIApplicationDidBecomeActiveNotification and UIApplicationDidBecomeActiveNotification notifications do not seem to be called when the app is only briefly closed.
Specifically: when the app enters the foreground it should check to see if any settings in the settings app were changed. If you go right to the settings app, change something, and come right back, the notifications are sometimes not sent. After closing and reopening the app again, they are called and everything is ok.
Is there a better way to consistently detect when the app enters the foreground? or could something be causing a conflict and keeping these notifications from being sent?
Rather than trying to catch every foreground transition, just watch for changes in the settings, no matter how they happen, by watching NSUserDefaultsDidChangeNotification. See How to get an update NSUserDefault on iOS 4?