ios 8 app shortcut in lock screen - iphone

There have been reports that an app shortcut appears in the left lower corner on the lock screen in iOS 8 if the phone is close to an iBeacon transmitter (it may also me triggered by location). I've even seen this work (somewhat unreliably) in previous iOS8 beta releases with my own app, compiled with the iOS 7 SDK. I didn't do anything special for this.
Now I'm trying to get this to work with iOS 8 GM seed but I just can't get the shortcut to appear, no matter what I try. I have not found any new API calls to support this feature.
Is there anything new I need to do? Do I need to ask for requestAlwaysAuthorization, or is requestWhenInUseAuthorization sufficient? Do I need to be ranging or monitoring?

The icon appears in iOS 8 whenever CoreLocation has triggered an app to enter the background as a result of monitoring for CLRegion enter/exit events. This applies to both beacons and geofences.
You do not need to do anything special to get the icon to appear. But you do need to set up region monitoring properly, and you need to be patient. Background monitoring events are not instantaneous. If you do not see the icon, that indicates an enter/exit region event has not yet fired.

Related

iOS7 - App causes device (not app) to crash

Our company has an app which is basically an eBook reader.
We use the RMSDK to perform book downloads & read.
Now, something very strange is happening in iOS7 devices (not in the simulator):
I download a book using the fulfillment method in the RMSDK
I wait for the book to finish downloading. The book is saved in the NSCachesDirectory (for App Store guidelines reasons) - so far, everything works fine
I hit the home button, the app moves to the background
I hit the app button to bring the app back, that's when the problem happens:
The app gets completely stuck. Hitting the home button does nothing, hitting the power button shuts down the screen, but then hitting the power button again does nothing.
The device itself has effectively crashed.
After a few minutes, the Apple logo appears on the device and the device comes back to life after a reboot.
I have no idea what in my code could be causing the device to act this way. Shouldn't the iOS7 sandbox prevent me from being able to crash the whole device?
Any ideas on why this could be happening and what I can do to prevent it would be greatly appreciated.
EDIT:
I placed a breakpoint on the -(void)applicationDidBecomeAcvive: method in the AppDelegate, and it's not being called when clicking on the app icon in the last phase before the crash.
EDIT:
The RMSDK is using libcurl to download the books. Could this be a cause for this behavior?
EDIT:
The problem is happening if I click on ANY app after I click on the home button, not just on the same app. So for example, I click on the home button, then I try to open Fruit Ninja, and the device crashes.
We managed to solve this issue by disabling functions in RMSDK, which call mkfifo(). I'm not sure how much I can say here due to NDA but they're all located in one file and can be cleanly converted to no-ops with a nice preprocessor #if defined()
Its an OS level bug. iOS 7 is still unstable in areas, for example my Apps report crashes in places that are part of iOS 7 itself and couldn't be caused by my app.

iphone:Multitasking in iphone not possible

Does iphone support multitasking for third party applications.Canone explain me how.
Assuming your device is newer than an iPhone 3G (or 1st gen iPod Touch), then yes, your application may run in the background. Note that even iOS4 doesn't allow multitasking on the older devices. What happens in iOS4 and above is that when you press the home button from an application, it switches the current app to the background - however, it is still running.
When working with games this means you have to use your application delegate to pause your game when the application is sent to the background, and (optionally) resume it when it returns, or present a "pause menu". It should also switch to a low/idle rendering loop (4FPS or similar), however, extra care has to be taken with iPad apps, which do not allow OpenGL rendering in an application that is currently in the background (in my experience). For these cases you have to completely disable the OpenGL render loop. These steps will prevent your application using unnecessary processing power while in the background.
You can see what's currently running in the background by double-tapping the home button on your device. The icons for all the apps will appear in a sliding list at the bottom of the screen. You can press and hold them to bring up the little X's allowing you to terminate the processes.

Strange iPhone App Launch Issue

I'm implementing secure passcode functionality within the app. Part of the solution is based on the PTPasscodeViewController sample code that can be found on GitHub. The issue I am having is when the app is first launched and the PIN is typed the UI is not updated with a circle in each box. If the 4 digits of the PIN that was entered are incorrect my message isn't displaying. It's as if the runloop isn't getting executed or something. If I enter the correct PIN the app is unlocked as expected. The functionality works but the UI isn't updated.
Once the app is unlocked if I go into Settings (in the app) and change the passcode the dots show up just fine and if during PIN confirmation the second PIN does not match the first the UI is also updated correctly.
Background multitasking is enabled in this app. On iOS 4.2.1 when the app becomes active again the same PIN validation logic is used as when the app is first launched. The only difference is it isn't really the first lauch but a return from the background. In this case, the PIN validation logic AND UI works correctly... the same code is executing. The dots and any messages are correctly displayed.
However, on 3.1.2, since background multitasking is not supported the app is always launched from scratch. So every time the app is launched the functionality works but the UI fails to update properly.
I must have a basic misunderstanding of something here but not sure what it is that I don't get. Can anyone point me in the right direction?
I resolved this issue myself and it was a result of a lack of understanding the fact that applicationDidBecomeActive also fires after applicationDidFinishLaunchingWithOptions. Basically the code to show the PIN validation screen was being executed twice in a row when lauching the app for the first time. Removing the PIN validation launch from applicationDidFinishLaunchingWithOptions and calling it only in applicationDidBecomeActive fixed it.

iphone location method startMonitoringSignificantChanges fails to work

i am developing an application for iphone using iOS 4.2 SDK.
My application need to popup an alert when a user arrives a specific location (in 400m radius). Note that I need to get this alert even if the app is in the background.
When I use the locationManager with startUpdatingLocation mode, i get the alert when the app is in the foreground, but not when it is in the background.
When I try to run with locationManager with startMonitoringSignificantChanges mode, i don't get any position changes in background and even not in foreground (i.e. didUpdateLocation method is never called. only once in the application start up)
some facts:
1. I updated info.plist with UIBackgroundMode with 'location' as first item in array.
2. I updated info.plist UIDeviceCapabilities with gps and location-services (though it doesn't really matters)
3. all said above refers to running this app on the 3GS iphone device.
4. I tried this app on sdk 4.0 and 4.1 and got the same problem.
5. The device supports startMonitoringSignificantChanges use (method of locationManager confirms it)
6. When I check the app on the device i move in range of ~150 meters meters. Is the startMonitoringSignificantChanges will call didUpdateLocation method with this kind of movement?
7. All settings on the devices are turned to on mode (roaming, 3G, wifi,...)
Am i missing something? any ideas?
Thanks,
if you're still interested, have a look at that post:
Behaviour for significant change location API when terminated/suspended?
and the example project mentioned:
http://www.cannonade.net/blog.php?id=1480

iPhone - fast-app switching and iOS 4

I'm trying to get the following functionality in my iPhone app:
When backgrounded, stays running (doesn't have to do any background work)
When resumed, app picks up where it was left off
I'm mainly wanting the same screen on my app still up, as there are several UINavigationControllers within a UITabBarController.
I have done all of the following:
Made sure I'm compiling with 4.1 SDK
Set UIApplicationExitsOnSuspend to false
Handle DidEnterBackground and WillEnterForeground in my AppDelegate
Call BeginBackgroundTask in DidEnterBackground, to attempt to keep my app open
I'm using MonoTouch, but that it probably beside the point. I can take answers in Obj-C, for sure.
I've tested my app on a jailbroken phone with Backgrounder, and I see the "app in background" badge disappear immediately after pushing the home button. I also tried setting UIBackgroundModes in my Info.plist, but to no avail.
Is there anything I'm missing?
Or is this something I would have to implement on my own to resume the previous state of my app? Everywhere I've read talks like it should just work automatically.
If you don't want to be doing work in background, don't call beginBackgroundTask. That call is for situations where you want to do some kind of work in the background. And if you don't finish that work fast enough, iOS will terminate your app.
When I upgraded to iOS 4.x, my MT application started exhibiting this behavior without me having to do anything. iOS should take care of it for you.
I finally got in touch with someone on MonoTouch's irc.
In MonoDevelop there is an option to make a dual iPad/iPhone project, which I used. This is causing my app to behave as if it's running with the 3.2 SDK when deployed to the device.
I think my solution is to install the iOS 4.2 SDK that just came out, since this ads the new multi-tasking feature on iPad.
Not only do you need to support going into the background, you also need to support cases where your app has been terminated. In your app’s initialization code, you should resume the state that it was in. For instance, when you push a view controller, use NSUserDefaults to store a value for the currently-displayed screen, and then when you start read that value and display the associated screen.