Summary:
Previously running apps failed to run geode code and reverse geode code. The reverse geode code fails because the geode code fails to provide a location. I then swathed to Apple's own LocateMe example code and also enabled the Location Services under Privacy. I also enabled the "Allow Location Access" under Location services to Always, but this setting changes back to nothing by itself after running the Apple's LocateMe or my own app.
Steps to Reproduce:
It seems location services SDK to get location is broken. The software that was previously working on iPhone 5 stopped working after upgrade to IOS 8.
Step 1. Load example LocateMe Apple's example Core Location example project;
Step 2. Under system settings enable Location Services, and also change the app's "allow Location Services" to always.
The Get-Location fails and "always" setting is removed.
Expected Results:
Getting location and location updates.
Actual Results:
See above.
Version:
IOS 8.0.0 and 8.0.2
Notes:
Configuration:
iPhone 5 and iPhone 6 Plus
Adding this this not help either:
[self.locationManager requestAlwaysAuthorization];
Use
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(#"8")) {
CLLocationManager *manager = [[LocationManager sharedInstance] clLocationManager];
[manager requestWhenInUseAuthorization];
[manager startUpdatingLocation]; // or what ever location function you need.
} else {
// The usual way for iOS <= 7
// (Do what you did before)
}
In addition to the above, you will have to add a string value for the key NSLocationWhenInUseUsageDescription in your info.plist file. The value is the string that is presented in the Altert when iOS asks the user whether to grant access to locations for your app or not.
For backward compatibility you may want to add the key NSLocationUsageDescription too.
Related
I have some odd behaviour in my app.
In my app delegate file I ask the user for permission to use their location while they use the app. This works fine and I can get their current location. After I get their initial location I stop updating location. Great. There is a button users can tap to start updating locations.
If the app is in the foreground I can see that locations are being added to my dictionary every second (I will change this to distanceFilter 10 later). If the user puts the app in to the background location services stop and I don't see the blue bar at the top of the screen.
I have:
Background modes for location updates enabled
NSLocationWhenInUseUsageDescription set (I am able to successfully ask the user for permission)
Started the location updates with startUpdatingLocation()
Tried setting the app to track location always (same result)
Deleted the app from my phone and reinstalled
In the previous version of my app (before Swift 2) this was working perfectly. I could see location being tracked even when the app was in the background.
I am testing on my iPhone not the simulator.
If anyone else has the same issue, I had updated my iPhone to iOS9 so it was required for me to add
locationManager.allowsBackgroundLocationUpdate = true
to my location manager.
The following worked for me, please note allowsBackgroundLocationUpdates is plural.
locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.allowsBackgroundLocationUpdates = true
I'm having an issue in MKMapView in iOS 8.x.x. Application works fine iOS 7.x.x but not in iOS 8.x.x. On device it shows only annotations but no map behind.
I tried to forcefully Reset my Device as well but no luck.
I added these 2 Values in info.plist as well as it was a requirement for iOS 8 and onwards
<key>NSLocationAlwaysUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
and added this lines of code in my Viewdidload.
// Check for iOS 8. Without this guard the code will crash with "unknown selector" on iOS 7.
if ([self.locationManager respondsToSelector:#selector(requestWhenInUseAuthorization)])
{
[self.locationManager requestWhenInUseAuthorization];
//[self.locationManager requestAlwaysAuthorization];
self.myMapView.showsUserLocation = YES;
}
By adding these 2 values in info.plist and the above lines of code, I'm able to get the User's Location and annotation in showing on map for user's location but Map is Blank.
Similar to this post:
MKMapView showing blank screen in iOS 8
Had the very same thing on IOS8.3 both sim and device.
Solved by running the system Maps App (it displayed empty grid as well) for a minute till it downloaded maps. After that my MKMapView started rendering as normal.
try add the delegate methods: - (void)mapViewWillStartLoadingMap:(MKMapView *)mapView;
- (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView;
- (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error;
and check the solution for you error message.
also check this solution i don't got rid of the grind but at least i got rid of the didFail error.
but seems to be an issue of iOS8 because on iOS8.3 works fine the same code.
self.mapView.myLocationEnabled = true
println("ml")
println(mapView.myLocation)
I got nil for mapView.myLocation and I'm using an iPod for testing not an emulator.
The iPod's 'location services' is on.
I'm using xcode 6 beta 5 and targeting ios 8.
Enabling location services does not mean you get a location right away. It usually takes a little bit of time to get a location. You need to enable KVO observing on that property to be notified of changes.
The main reason is I need to declare NSLocationWhenInUseUsageDescription in info.plist for ios 8. Then everything else works!
I am trying to set up iCloud within my iOS application, I have done the following:
Removed all old certs on mac.
Added iCloud to the App in Dev Console - created new container and added to app
Redone the dev provision and downloaded
Installed the provision
Added the iCloud Entitlement to the app
And this is where is all goes wrong...
I can't get the app running again, the app is building but I am getting an error saying:
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
Any ideas??
UPDATE: I have managed to be able to run the application to get everything programmed and put in place, everything is set up iTunes Connect end, all provisions are valid and sync'd.
Now I am getting errors during validation...
There are 4: Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported by iOS. Specifically, key 'com.apple.developer.icloud-container-identifiers' in Payload ------- not supported
Other 3 are similar for other containers!
Maybe it's a late comment, but I post it here in case that somebody is struggling for the same reason.
I encountered this issue on Xcode8 recently when I was trying to archive. Generally, I enabled iCloud with Xcode in following steps:
Enable iCloud inCapabilities panel in my target by setting the toggle to ON.
Check iCloud under my App Identifier in Member Center turns green automatically, and a iCloud container is created automatically with my App Identifier. (Apple's system does this for us.)
Regenerate my certificate with my App Identifier.
Create a new provisioning profile.
Download and install the new certificate and provisioning profile
Select the new provisioning profile in Signing(Release) section in General panel in my target.
Then I got errors like:
Provisioning profile "iCloud Test" doesn't include the com.apple.developer.ubiquity-container-identifiers,
com.apple.developer.icloud-container-identifiers,
and com.apple.developer.icloud-services entitlements.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
At last I found that there were two options in iCloud section under my App Identifier in Member Center. By default, the Compatible with Xcode 5 was selected, but I succeeded by selecting the other option.
If you're just adding iCloud to an app for the first time or want to upgrade to use CloudKit after using an older iCloud container:
Go to the Apple Development Center.
Choose Certificates, IDs & Profiles.
Use the dropdown on the top left to switch between iOS/tvOS/watchOS or macOS
Choose App IDs under the Identifiers section.
Choose your app from the list.
Scroll down to iCloud and make sure it is enabled with a green dot.
If it's not enabled or has a yellow dot, click the button at the bottom of the page to Edit and make sure you've checked iCloud service.
You may also need to create a container under the iCloud Containers section then associate it with this app.
After submitting a report to Apple, it turns out that Apple systems are useless AGAIN!
Ok, so if you are creating a NEW application or you are only just adding iCloud to your application - you will need to make sure the system doesn't pick up or create a iOS8 cloud container!
If it does you need to remove it from your app entitlements file, remove the selected containers in the Apple Developer Console and re-download certs again!
Thanks Apple again!
I got blamed for using pre-released software! I haven't touch Xcode 6 yet!!!
What I did:
- leave only com.apple.developer.icloud-services in entitlements file
- in Capabilities under iCloud marked key value storage and iCloud Documents (cloud kit EMPTY)
- Containers set to specify custom but do not select any of your containers
- This will probably give you RED warning sign under steps but leave it as it is DO NOT FIX
- Regarding provisioning profile Development and Distribution profiles have to have App ID which has iCloud enabled but NOT linked to any container
- In those provisioning profiles set under iCloud OLD version for Xcode 5 etc. not a new one related to iCloud containers
I had an error of "Add iCloud Containers to your App ID".
Automatic signing was unable to resolve an issue with target's entitlements.
I don't even use iCloud Containers, only Key-value storage(keychain).
I also switched in iCloud section under my App Identifier in Member Center from "Compatible with Xcode 5" to "Include CloudKit support (requires Xcode 6)" problem still remains.
So I fixed it like this:
Enable iCloud Capabilities panel in my target by setting the
toggle to ON.
Turn on "Include CloudKit support (requires Xcode 6)" in Member
Center (still got same error).
in Xcode in iCloud Capabilities TURN ON CloudKit (even if you don't
need it) and then turn OFF.
And then problem solved for me!
I am running IOS8 on this device.
I'm using location services for an ios app. It has worked well for a long time, however recent I am no longer receiving location updates.
One thing I checked is in Settings->Privacy->Location Services, whether it was enabled for the app. Oddly, while all other apps were set to Always, or Never, my app was the only one with a blank value. Neither was set. After I choose Always, and run the app, it doesn't help. When coming back to settings it is once again blank.
Interestingly, the same code works fine on my other IOS7 device, with location updates okay.
A few additional settings are needed for IOS8 location services to work out of the box. It is described here well. This solved it.
Location Services not working in iOS 8