Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location can't be work now using built hint codename1.ios.xcode_version=9.2 #2366

Closed
DurankGts opened this issue Mar 16, 2018 · 37 comments
Closed

Comments

@DurankGts
Copy link
Contributor

I have check your last commit changes and I could check that you commented the lines in the file CodenameOne_GLViewController.h

//#define INCLUDE_CONTACTS_USAGE
//#define INCLUDE_CALENDARS_USAGE
//#define INCLUDE_CAMERA_USAGE
//#define INCLUDE_FACEID_USAGE
//#define INCLUDE_LOCATION_USAGE
//#define INCLUDE_MICROPHONE_USAGE
//#define INCLUDE_MOTION_USAGE
//#define INCLUDE_PHOTOLIBRARYADD_USAGE
//#define INCLUDE_PHOTOLIBRARY_USAGE
//#define INCLUDE_REMINDERS_USAGE
//#define INCLUDE_SIRI_USAGE
//#define INCLUDE_SPEECHRECOGNITION_USAGE
//#define INCLUDE_NFCREADER_USAGE

Then I check that in the file IOSNative.m you need to instance the Location natively.

But if you commented how the location it will work properly?

@DurankGts
Copy link
Contributor Author

could you see this committ
3f7b2f5#diff-68868771f872460be4c496d3112d0a07

@shannah
Copy link
Collaborator

shannah commented Mar 16, 2018

Are you including the ios.locationUsageDescription build hint?

@DurankGts
Copy link
Contributor Author

I have this buil hints

codename1.arg.ios.locationUsageDescription=xxxxx
codename1.arg.ios.NSLocationAlwaysUsageDescription=xxxxxxx
codename1.arg.ios.NSlocationUsageDescription=xxxxxxxxx

@DurankGts
Copy link
Contributor Author

you committed this constant in CodenameOne_GLViewController.h

//#define INCLUDE_LOCATION_USAGE

@DurankGts
Copy link
Contributor Author

you commented this constant in CodenameOne_GLViewController.h

//#define INCLUDE_LOCATION_USAGE

@shannah
Copy link
Collaborator

shannah commented Mar 16, 2018

That gets uncommented automatically if you include either ios.locationUsageDescription or ios.NSLocationUsageDescription build hints. Notice that your ios.NSLocationUsageDescription is wrong vecause you use a lower-case "l" should be upper case. However, it should work anyways due to the ios.locationUsageDescription build hint.

You can use the include sources option to check the resulting source code and verify that it is uncommented.

@DurankGts
Copy link
Contributor Author

I check the resulting source code in xcode and it is commentted, Please check

@shannah
Copy link
Collaborator

shannah commented Mar 16, 2018

I've already verified. Working fine for me.

@DurankGts
Copy link
Contributor Author

What the means that? I check that the resulting code of you built server it commentted this line
//#define INCLUDE_LOCATION_USAGE

@DurankGts
Copy link
Contributor Author

The problem it continue yet... Please help me to solve it

@DurankGts
Copy link
Contributor Author

Could you write the correct way to add this built hint? The problem it continue... The dialog prompt of the location it never appear in ios.

@codenameone
Copy link
Collaborator

ios.NSLocationUsageDescription & not ios.NSlocationUsageDescription

@DurankGts
Copy link
Contributor Author

DurankGts commented Mar 19, 2018 via email

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Should be codename1.arg.ios.NSLocationUsageDescription not codenameone.arg.ios.NSLocationUsageDescription.

Probably best not to edit the build hints directly in the settings file so you don't make mistakes like this.

@DurankGts
Copy link
Contributor Author

DurankGts commented Mar 19, 2018 via email

@DurankGts
Copy link
Contributor Author

The problem it continue although I added your recommended built hint . I don't know what is the problem but when I see the Location permission settings, I could check that nothing option are selected
and it just appear option "Never" but it never launch the Location Permission dialog prompt.
locationissue

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Post your full codenameone_settings file so I can see all of your build hints. I can't reproduce this issue.

@DurankGts
Copy link
Contributor Author

ok this my full codenameone_settings. Before you analyze my codenameone_setting. It necessary that you Know that I'm doing the test in IPHONE 6 IOS 11.2.5. I made the test in other iphone 5 IOS 10.3.1 and the Location permission dialog is prompted perfectly.

codename1.ios.appid=Q3M78PUB2Y.com.geotracksolutionsint.multiasistenciaglobal
codename1.ios.release.provision=cert/ios/csr_081217/mp/dist_pp_multiasistenciaGlobal_300317_300318.mobileprovision
codename1.arg.java.version=8
codename1.arg.ios.objC=true
codename1.j2me.nativeTheme=nbproject/nativej2me.res
codename1.arg.ios.project_type=iphone
codename1.arg.ios.keyboardOpen=false
codename1.arg.ios.interface_orientation=UIInterfaceOrientationPortrait:UIInterfaceOrientationPortraitUpsideDown
codename1.displayName=Multiasistencia Global
codename1.arg.android.installLocation=internalOnly
codename1.arg.ios.pods.platform=7.0
codename1.android.keystoreAlias=android_cert_forcesos_ag
codename1.arg.android.xapplication=<service android:name=".natives.SvcPwrMngtImpl" android:enabled="true" android:stopWithTask="false" ><service android:name=".natives.IsvcValrtButtonImpl" android:enabled="true" android:stopWithTask="false"><meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
codename1.arg.ios.enableBadgeClear=true
codename1.arg.android.asyncPaint=false
codename1.ios.release.certificate=cert/ios/csr_081217/certs_p12/dist_gts_forcesos_280817_280818.p12
codename1.arg.ios.background_modes=fetch,location
codename1.android.keystorePassword=xxxxxxxx
codename1.arg.ios.add_libs=CoreTelephony.framework;SystemConfiguration.framework;libc++.dylib;libicucore.dylib;libz.dylib;CoreData.framework;CoreText.framework;GLKit.framework;ImageIO.framework;
codename1.arg.ios.NSLocationAlwaysUsageDescription=It will be used to send user's current location to emergency response center
codename1.arg.ios.dsym=true
codename1.arg.android.release=true
codename1.arg.ios.glAppDelegateHeader=\n#import "GoogleMaps/GoogleMaps.h"
codename1.arg.ios.statusbar_hidden=true
codename1.arg.ios.newVM=true
codename1.arg.ios.afterFinishLaunching=[GMSServices provideAPIKey:@"xxxxxxxxxxxxxxxxxxxxx"];
codename1.arg.crash_protect=false
codename1.arg.android.min_sdk_version=16
codename1.arg.ios.newPipeline=true
codename1.languageLevel=5
codename1.android.keystore=cert/android/android_cert_forcesos_ag.ks
codename1.arg.ios.pods=,GoogleMaps
codename1.vendor=Geotrack Solutions SRL
codename1.arg.ios.NSContactsUsageDescription=It will be used to create a contact of Emergency call request
codename1.arg.win.ver=8
codename1.arg.android.playService.maps=true
codename1.arg.zooz.sandbox=false
codename1.arg.android.versionCode=224
codename1.arg.ios.NSCameraUsageDescription=It will be used to take a client picture an added to its profile
codename1.ios.debug.certificatePassword=xxxxxxxxxxxxxx
codename1.ios.debug.archs=arm64
codename1.mainName=ForceSOS
codename1.arg.ios.pods.sources=,https://github.com/CocoaPods/Specs.git
codename1.ios.release.certificatePassword=xxxxxxxxxxxxxx
codename1.arg.ios.NSLocationUsageDescription=It will be used to send user's current location to emergency response center
codename1.arg.ios.prerendered_icon=true
codename1.arg.vserv.scaleMode=false
codename1.ios.debug.certificate=cert/ios/csr_081217/certs_p12/dev_kdp_forcesos_gts_280817_280818.p12
codename1.arg.android.gradle=true
codename1.arg.ios.xcode_version=9.2
codename1.arg.android.captureRecord=disabled
codename1.arg.android.xpermissions=<uses-permission android:name="android.permission.CALL_PHONE"/><uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_PHONE_STATE"/><uses-permission android:name="android.permission.READ_CONTACTS"/><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/><uses-permission android:name="android.permission.BLUETOOTH"/><uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/><uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/><uses-feature android:glEsVersion="0x00020000" android:required="true"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/><uses-feature android:glEsVersion="0x00020000" android:required="true"/>
codename1.ios.objC=true
codename1.arg.ios.application_exits=false
codename1.description=Emergency Application
codename1.secondaryTitle=MultiasistenciaGlobal
codename1.ios.debug.provision=cert/ios/csr_081217/mp/dev_pp_multiasistenciaGlobal_280817_280818.mobileprovision
codename1.arg.build.incSources=1
codename1.arg.ios.deployment_target=8.0
codename1.android.includeGPlayServices=true
codename1.arg.j2me.nativeThemeConst=0
codename1.version=2.7
codename1.arg.ios.bundleVersion=224
codename1.icon=icon.png
codename1.arg.ios.plistInject=UIViewControllerBasedStatusBarAppearanceUIStatusBarStyle UIStatusBarStyleLightContent UIApplicationExitsOnSuspendCFBundleURLTypesCFBundleIdentifierCFBundleTypeRoleEditorCFBundleURLSchemesprefsMinimumOSVersion8.0NSAppTransportSecurityNSAllowsArbitraryLoads
codename1.arg.android.debug=false
codename1.arg.vserv.transition=200000
codename1.arg.ios.includePush=true
codename1.arg.ios.testFlight=true
codename1.packageName=com.geotracksolutionsint.multiasistenciaglobal

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

You're missing the ios.locationUsageDescription build hint.

@DurankGts
Copy link
Contributor Author

I had tested with this built hint or without its and the problem it continue yet. is this the correct syntax?
codename1.arg.ios.locationUsageDescription=It will be used to send user's current location to emergency response center

sincerely I don't know witch build hints now are necessary to get location, because you tell me if I have the
codename1.arg.ios.NSLocationUsageDescription=It will be used to send user's current location to emergency response center
codename1.arg.ios.NSLocationAlwaysUsageDescription=It will be used to send user's current location to emergency response center

it should work.

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Just use ios.locationUsageDescription.

This build hint has been required for a long time (since iOS 7, I think).

@DurankGts
Copy link
Contributor Author

I know that this build hint has been required from IOS 7 but when you update your server to xcode 9.2 some problem you introduced.Because my app it work perfectly.

I tested again adding this but it continue the problem. Now I will test removing the.

codename1.arg.ios.NSLocationUsageDescription=It will be used to send user's current location to emergency response center
codename1.arg.ios.NSLocationAlwaysUsageDescription=It will be used to send user's current location to emergency response center

@DurankGts
Copy link
Contributor Author

I know that this build hint has been required from IOS 7 but when you update your server to xcode 9.2 some problem you introduced, because my app it worked perfectly.

I tested again adding this but it continue the problem. Now I will test removing the.

codename1.arg.ios.NSLocationUsageDescription=It will be used to send user's current location to emergency response center
codename1.arg.ios.NSLocationAlwaysUsageDescription=It will be used to send user's current location to emergency response center

@DurankGts
Copy link
Contributor Author

the problem it continue yet

@DurankGts
Copy link
Contributor Author

I has tested all possible combination of this build hints and the problem it continue. It never the Location Permission dialog it prompted. I See the resulting code an I could check that all is ok but I don't know where is the problem...

@DurankGts
Copy link
Contributor Author

I has check that the resulting code of your built server does not include
inside the Info.plist the string

NSLocationAlwaysUsageDescription
Optional message

please check. I just add the

NSLocationWhenInUseUsageDescription
...

I try adding the

codename1.arg.ios.NSLocationWhenInUseUsageDescription=It will be used to send user's current location to emergency response center

and it work at use app but not working Always use location

Please check....

https://stackoverflow.com/questions/26005122/requestalwaysauthorization-not-showing-permission-alert

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Don't use the NSLocationXXXUsageDescription directives.
Use ios.locationUsageDescription

If you need access to background location, then you also need the ios.background_modes=location directive.

These are not new. These have not changed.

@DurankGts
Copy link
Contributor Author

DurankGts commented Mar 19, 2018 via email

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Remove all of your ios.NSLocationXXXXUsageDescription build hints. Only use ios.locationUsageDescription and ios.background_modes=location

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

Upon further review, I have found a regression.

For now, you should be able to workaround it by using the following build hints:

ios.locationUsageDescription=xxx
ios.background_modes=location
ios.NSLocationAlwaysAndWhenInUseUsageDescription=xxx
ios.NSLocationWhenInUseUsageDescription=xxx

There will be a fix posted shortly so that you can return to just using

ios.locationUsageDescription=xxx
ios.background_modes=location

@shannah shannah closed this as completed Mar 19, 2018
@DurankGts
Copy link
Contributor Author

I test again with your last sugestion and the problem it continue. Where this change it will available in build server?

@DurankGts
Copy link
Contributor Author

I test again with your last sugestion and the problem it continue. When this change it will available in build server?

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

If those build hints don't work for you, then the build server update won't help you.

@DurankGts
Copy link
Contributor Author

DurankGts commented Mar 19, 2018 via email

@DurankGts
Copy link
Contributor Author

DurankGts commented Mar 19, 2018 via email

@shannah
Copy link
Collaborator

shannah commented Mar 19, 2018

If you have all of these build hints:

ios.locationUsageDescription=xxx
ios.background_modes=location
ios.NSLocationAlwaysAndWhenInUseUsageDescription=xxx
ios.NSLocationWhenInUseUsageDescription=xxx

And it still doesn't work, then I can't tell you what's wrong. You may need to download the sources and build/run in Xcode.

The only regression that I fixed was that starting with Xcode 9, Apple now requires that you specify all 3 privacy usage descriptions:
ios.NSLocationAlwaysAndWhenInUseUsageDescription
ios.NSLocationWhenInUseUsageDescription
ios.NSLocationAlwaysUsageDescription

if you want to run background location. It used to only require one of ios.NSLocationWhenInUseUsageDescription and ios.NSLocationAlwaysUsageDescription.

If you add all of the build hints that I suggested, it will add all of these. You can verify by downloading the sources and looking at the info.plist

@DurankGts
Copy link
Contributor Author

the problem was solved adding this

codename1.arg.ios.locationUsageDescription=xxxx
codename1.arg.ios.NSLocationAlwaysUsageDescription=xxcccccc
codename1.arg.ios.NSLocationWhenInUseUsageDescription=xcccccxxxxxxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants