I have a problem trying to publish my APK to the Google Play store. It says I must update my API level at 28. The application uses a maps service, so it must have the Internet and GPS permissions.
Does anyone know how to update the API level on Delphi?
Simply customize your project's AndroidManifest.xml file to set the <uses-sdk> element's minSdkVersion, maxSdkVersion, and targetSdkVersion values as needed.
Related
Okay, I must be an unbearable noob to iOS programming, using API's or using XCode in general, because apparently changing the API-Keys in my program to any sort of Restricted API Key breaks my program.
I'm building my app using flutter (Writing most of the code in VSCode).
In my pubspec.yaml I have the following dependencies (Just incase it's relevant).
dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.15.4
google_sign_in: ^4.1.4
firebase_core: 0.4.4
google_maps_flutter: ^0.5.24+1
geolocator: ^5.3.0
flutter_google_places: ^0.2.4
geocoder: ^0.2.1
http: ^0.12.0+4
intl: ^0.16.1
If I use the unrestricted Web API Key for my program, as the googleMapKay, I have no problems, and the following code works perfectly.
Future<void> _originAutocomplete() async {
Prediction p = await PlacesAutocomplete.show(
context: context,
apiKey: googleMapKey,
mode: Mode.overlay,
language: "en",
location: new Location(last_known_position.latitude, last_known_position.longitude),
radius: 100000,
components: []);
if (p == null) {
print('p is null');
}
originSelected(p);
}
If however I use the ios-app Restricted API-Key for the same line, p is suddenly null. Now I am using firebase, and I've included the GoogleServices.plist in the program correctly. I've updated the API-Key in my AppDelegate.swift in XCode as well, and also updated the API-Key in the program itself.
I've been testing this on a vairety of devices, iphone se, 5s, 8+, and on simulators for ipad pro 12.9" (third generation), and iphone 11 pro max. In all cases, I have the same error, AND it's fixed when using the unrestricted web API's, which I cannot use in the final release build of the product.
I did also verify that the Restricted API-Key is set to only restrict via iOS apps, and that the bundle-identifier of the program is correctly set inside the google API-Key restrictions. (And that there is only application resrictions, no api-restrictions). So I don't THINK that is the problem, but if you can show me a way to test, then I'd appreciate! After a little testing I found the copy of the key inside the AppDelegate file doesn't seem to matter, so that one can be restricted without an issue.
After looking into the documentation for flutter_google_places, apparently this has an innate dependancy for google_maps_webservices which requires a web-api to function. (If I understand correctly this means an unrestricted key?). This does state that the "correct" industry best-practice would be to use a proxy server?
I'm not 100% familiar with this process, or how to do it, or if there's any simple or easy methods to get this working, so any assistance you can provide would be MUCH appreciated!
Google Maps Platform APIs needs to have API key in the request to work properly. API keys are recommended to have restrictions set on them to secure and protect your keys. Please note that there are different type of restrictions that you can use for your API key and these restrictions should match the appropriate services that are using it, or else, it will throw an error.
I can see that you are using the Google places autocomplete widgets for flutter and this seems to use the Places webservice API. Please know that Places Webservice API is not compatible with iOS restrictions since the APIs/SDKs that can only use this restriction is Places SDK for iOS and Maps SDK for iOS. This might be the reason why you are having the issue when using an iOS restricted API key. You might consider just using an API restriction and restrict your key with the Google Maps Platform API your flutter app is using.
Also, on mobile apps that uses Web Service APIs, you can consider the following technics to safeguard yur API keys: Use a proxy server, Obfuscate or encrypt the API key or signing secret and Use CA pinning or certificate pinning to verify the server resources are valid. These are discuss in this link.
I am using "react-native-webview" to render html on Android and iOS. I have created the application and ready to create build, On Android I have successfully created the debug-build but on iOS, we can generate the ipa file and unable to upload into "TestFlight". As we can see this plugin using "geolocation" in background to fetch current location of web page on mobile web view (I have checked other 3rd party libraries and SDK but not found). But in my application, i'm not using any kind of permission related to location just render the html on available in JSON string format.
From App Store we are getting the Location related permission. The
following email we are getting:
Dear Developer, We identified one or more issues with a recent
delivery for your app, "app-name". Please correct the following issues,
then upload again. "Missing Purpose String in Info.plist File. Your
app's code references one or more APIs that access sensitive user
data. The app's Info.plist file should contain a
NSLocationAlwaysUsageDescription key with a user-facing purpose string
explaining clearly and completely why your app needs the data.
Starting spring 2019, all apps submitted to the App Store that access
user data will be required to include a purpose string.If you're using
external libraries or SDKs, they may reference APIs that require a
purpose string. While your app might not use these APIs, a purpose
string is still required. You can contact the developer of the library
or SDK and request they release a version of their code that doesn't
contain the APIs. Learn more
(https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy)."
"Missing Purpose String in Info.plist File. Your app's code references
one or more APIs that access sensitive user data. The app's Info.plist
file should contain a NSLocationWhenInUseUsageDescription key with a
user-facing purpose string explaining clearly and completely why your
app needs the data. Starting spring 2019, all apps submitted to the
App Store that access user data will be required to include a purpose
string .If you're using external libraries or SDKs, they may reference
APIs that require a purpose string. While your app might not use these
APIs, a purpose string is still required. You can contact the
developer of the library or SDK and request they release a version of
their code that doesn't contain the APIs. Learn more
(https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy)."
Best regards, The App Store Team
They require **Purpose String ** to publish our app in iOS "Info.plist".
If we use only this permission on Info.plist file:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app does not uses any location.</string>
Is it okay if this plugin using geolocation internally but my app not using any location related services?
Check for updates in the SDK documentation because he might have updated new version after removing this permissions or some other workaround.Most libraries i used recently has been updated due to this permission issue.
Secondly you can check the SDK code and try to remove the permissions yourself because your app is not using this permission so it wont be a problem for you.
To search for permissions to be removed you can use below command to search all the occurrence of permissions inside code .
grep -R "your Permission name" .
Hope it works for you !
I'm developing an app in UWP. I need to send to my printer a RAW string (or file) and get that printed. I succed in using the old RawPrinterHelper from here.
I have some problems verifiyng the app using the Windows App Certification Kit.
I get errors like this one :
API ClosePrinter in winspool.drv is not supported for this application type. MyApp.dll calls this API.
I think that DllImport() in RawPrinterHelper is wrong.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way?
P.S. I need to publish the app on the Microsoft Store.
If you have already run the WACK test with the release build, then as the error described there are APIs not supported for the windows store app. More details please reference Supported API test.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way
For print relative features in windows store app, please follow this tutorial and the official sample. This provide alternatives to the windows print relative APIs. Details please reference Printing and documents section of Alternatives to Windows APIs in Universal Windows Platform (UWP) apps.
If you want the print feature with no print dialog you may reference this thread.
I use the plugin cordova-plugin-geolocation. My only issue is that the message prompt to allow location looks like this:
/var/container/bundle/application/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/my_project/www/index.html
Would like to use your location.
Is there anyway to have something a little bit sexier, like
my_project would like to use your location
Cheers.
Added some code, for the non believers
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
navigator.geolocation.getCurrentPosition(onLocationSuccess, onLocationError, {maximumAge:3000, timeout:2000, enableHighAccuracy:true});
function onLocationSuccess(){
}
function onLocationError(){
}
}
The solution has changed for cordova-plugin-geolocation: "4.0.0". This is what you need to add in your config.xml:
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
For more information: https://github.com/apache/cordova-plugin-geolocation
From docs:
iOS Quirks
Since iOS 10 it's mandatory to add a NSLocationWhenInUseUsageDescription entry in the info.plist.
NSLocationWhenInUseUsageDescription describes the reason that the app
accesses the user's location. When the system prompts the user to
allow access, this string is displayed as part of the dialog box. To
add this entry you can pass the variable GEOLOCATION_USAGE_DESCRIPTION
on plugin install.
Example: cordova plugin add cordova-plugin-geolocation --variable
GEOLOCATION_USAGE_DESCRIPTION="your usage message"
If you don't pass the variable, the plugin will add an empty string as
value.
To solve your problem, try:
Uninstall the plugin:
cordova plugin remove cordova-plugin-geolocation
Reinstall with:
cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="my_project would like to use your location"
There are 3 possible reasons for displaying the path to the index.html instead of the name of your app:
You have not installed the plugin (or it's not installed correctly)
You are not waiting for the device ready event to call the plugin
You have not linked the cordova.js file in the index.html
As you say that you have installed the plugin and you are using it on device ready event, then it must be that you have forgotten to link the cordova.js in the index.html or the plugin wasn't installed correctly.
Check that you have the cordova.js linked and if you have it, remove the plugin and add it again, removing and re adding the iOS platform might help too
It seems like the version 3.0.0 of cordova-plugin-geolocation ignores the install parameter
--variable GEOLOCATION_USAGE_DESCRIPTION=""
like Bruno Peres said above.
It works fine for me installing the 2.4.3 version.
If you are targetting iOS 8 and later (I my opinion, no need to target older versions anymore...), there are two keys available for configuration:
NSLocationAlwaysUsageDescription
This key lets you describe the reason your app accesses the user’s location information at all times. Include this key when your app uses location services in a potentially nonobvious way while running in the foreground or the background. For example, a social app might include this key when it uses location information to track the user’s location and display other users that are nearby. In this case, the fact that the app is tracking the user’s location might not be readily apparent. The system includes the value of this key in the alert panel displayed to the user when requesting permission to use location services.
NSLocationWhenInUseUsageDescription
This key lets you describe the reason your app accesses the user’s location information while your app runs in the foreground and otherwise when in use. Include this key when your app uses location services to track the user’s current location directly. This key does not support using location services to monitor regions or monitor the user’s location using the significant location change service. The system includes the value of this key in the alert panel displayed to the user when requesting permission to use location services.
So in your iOS project info.plist file you can add the following:
<key>NSLocationAlwaysUsageDescription</key>
<string>my_project requires constant access to your location, even when the screen is off.</string>
Access location only when app is used
<key>NSLocationWhenInUseUsageDescription</key>
<string>my_project requires access to your location only when being used.</string>
I want add Google play Saved Games API to my game, to sync game data to different devices, but when I run sdk sample(“SavedGames” and "CollectAllTheStars2",I found the data just can be sync at local device,when uninstall the app or install app to another device and use same account to login,the game data can not be sync, the sample's data select page just show message:
"there are no saved games at this time"
I don't know what's going on.
ps: I'm using eclipse,so the sdk library what I using is get from the path:
android-sdk-windows\extras\google\m2repository\com\google\android\gms"
I Extract the jar files manually from .aar file(eg. play-services-base-9.4.0.aar)
so finally I use these jar files:
play-services-base9.4.0.jar
play-services-basement-9.4.0.jar
play-services-drive9.4.0.jar
play-services-games9.4.0.jar
play-services-plus-9.4.0.jar
I don't know where is the problem,why the data cannot be sync when I use the same google account to login at different device
someone please help me?
Be aware that Eclipse is no longer officially supported for Android Development. Using Eclipse may be preventing you to quickly creating apps and finding the necessary resources to build a project. So I recommend you to not use Eclipse in doing Android project. So maybe it is one of the reason that you encountered this problem.
Also, make sure you read this documentation about Adding Saved Games to Your Android Game, it explains here all the things you need to do in order to work your Saved Games in your project. It includes sample code that you can copy or follow.
NOTE: Make sure you enable the Saved Games service in the Google Play
Developer
Console.