How to get app version (Play / iTunes) stores using Codename one - google-play

How do I get published apps version number from Google Play store and Apple App Store with App ID?
Is there any Rest API to provide apps version on stores?.

You can't get the store version but your own version, the version number you put in before submitting the app to stores.
Use Display.getInstance().getProperty("AppVersion", "1.0")
To change your version number, right-click the app and select properties then change the Version number as necessary. The version you put in will be returned whenever you call the above line.

Related

How to upload directly to the app / play store using fastlane's action 'appcenter_upload'

I have been trying to use appcenter_upload() in my fastfile to upload our builds to the appcenter and the play / app store. It successfully uploads to the appcenter but it doesn't successfully upload to the stores. It tells me 'Not found, invalid distribution store name, store 'App Store' was not found'.
The arguments I am using look like this:
appcenter_upload(
file: options[:BUILD_OUTPUT],
destinations: "App store",
destination_type: "store",
upload_build_only: true)
It doesn't recognize 'App store' as a name for a store. I have looked through the documentation and this one (link below) shows the 'destinations' as Alpha. I did try alpha but it tells me 'Not found, invalid distribution store name, store 'Alpha' was not found'. Example can be found above and at the link below
(Link: enter image description here)
In the 'fastlane-lugin-appcenter's readme, it says that 'Comma separated list of destination names, use '*' for all distribution groups if destination type is 'group'. Both distribution groups and stores are supported. All names are required to be of the same destination type (default: Collaborators)'
What I am trying to accomplish: upload our builds to the app center (already done, have multiple builds in there) AND have it be uploaded to both the Google Play Console and the App Store Connect.
The main question I have is: What are the values that can be used for 'destinations' when we are trying to upload to a store and not a group of testers within AppCenter? Can anyone help me with this I would REALLY appreciate it, thank you so much in advance!
Fastlane action documentation (repo): https://github.com/microsoft/fastlane-plugin-appcenter/tree/f46cb07ae3fad3cadd57e349c662f80cd769121f
I tried using the arguments suggested here: https://github.com/microsoft/fastlane-plugin-appcenter/blob/f46cb07ae3fad3cadd57e349c662f80cd769121f/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb#L709-L716
It successfully uploads to the app center, but it doesn't recognize the store name so it doesn't upload to the store. We already connected our team's store accounts from within the AppCenter. It is being uploaded through Jenkins so I am not directly uploading it so I don't think that I would need to login with my credentials to send the build.
I expected to have the build upload to the app center (already done) AND have the build upload to the stores as well. The documentation states that I need to simply state the 'destination_type: store' and the 'destinations' as the store's name.
What actually happened was that it uploads only to the app center and it doesn't recognize the store's name so it doesn't upload to the stores. We are trying to automate the process but we are blocked on this step specifically and there isn't too much documentation related to it. (specifically uploading to the stores AS WELL as uploading to the app center.) The readme states that it is possible but I can't get it to work. Any help would be VERY appreciated!!

Google Drive Files/Spreadsheets REST API: How to avoid delay when tracking file changes?

I have an application where I need to keep local copies of some of my user's Google Spreadsheets, and this copy should be in sync with the Google Drive version. I've been testing two methods of tracking changes to a Google Spreadsheet: (1) the file version polling method and (2) the files.watch method.
1) The file version polling method
In this method, whenever I need the most recent version of a Spreadsheet (for instance, when the user wants to download the file from my application), I retrieve the file version from Google using:
POST https://www.googleapis.com/drive/v3/files/FILE_ID?fields=version
If the version is greater than the version I have stored on my end, I know that changes have been made and the file on my end is outdated. So I download the file and update my copy.
The problem is that it takes a while for the file version number to be updated on Google's end. Ideally, after editing a Google Spreadsheet cell, my application should be able to detect this change within less than 10 seconds. However, after editing a cell and seeing the Saved to Drive confirmation at the top, sometimes it takes seconds, other times it takes minutes before the version number gets updated, so it is very inconsistent.
Aside from the version number, I've also tried polling the modifiedTime value to see if it changed sooner, but it didn't. So I tried another method.
2) The files.watch method
In this method, I keep track of the file changes by registering a webhook to receive change notifications from Google:
POST https://www.googleapis.com/drive/v3/files/FILE_ID/watch
Whenever I receive a change notification, I know that I need to update my local copy.
Unfortunately, the change notifications also don't happen as quick as I would like. It also has very inconsistent delays: sometimes taking a few seconds, sometimes taking more than a minute.
UPDATE (3) The 'always export' method? Never cache method?
To complicate matters, it seems that even if I ignore my local copy and always try to download the latest version of the file directly from Google, the downloaded file will not necessarily be the absolute latest version that the user sees on the Spreadsheets editor. I tried that using
GET https://www.googleapis.com/drive/v3/files/FILE_ID/export?mimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
but it would often return the outdated version, and sometimes would only return the latest version after a few minutes.
Is there something else that I can try? The above methods use the Google Drive Files API, but if there is a way to detect changes sooner using the Google Spreadsheets API, I would like to know.
1. How to detect file changes as soon as possible?
After a file change (in my case, a change in a Google Spreadsheet), the version does not get updated immediately, and when you watch for file changes with the files.watch API you will also not get a notification immediately.
What does get updated immediately is the list of revisions of the file, which can be retrieved with the revisions.list API:
GET https://www.googleapis.com/drive/v3/files/FILE_ID/revisions
This returns a list of all revisions of the file FILE_ID. The last item in the list is the most recent revision (the "head" revision). In order to know if a file has changed, I retrieve this list. If the id of head revision is different from the id stored in my end, it means that my local copy is outdated, so I have to update the file and its revision id.
However, if you call files.export, the file version returned will not necessarily be the absolute most recent version (e.g., the Google Sheet you are seeing in your browser). And in the case of Google editor documents, it is not possible to retrieve the most recent revision using the revisions.get API. What can you do then?
2. How to retrieve the most recent revision of a Google Sheet?
(I bet it works for other Google editor documents as well).
Before calling files.export, you have to "touch" the file using the files.update API, updating its modifiedTime:
PATCH https://www.googleapis.com/drive/v3/files/fileId
{
"modifiedTime": "TIMESTAMP"
}
Where TIMESTAMP is a date with the format 2022-04-16T22:00:00Z.
For some reason, touching the file like this "forces" Google to return the head revision of the file the next time you call files.export:
GET https://www.googleapis.com/drive/v3/files/FILE_ID/export?mimeType=MIMETYPE
In my case, MIMETYPE is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.
That's it. So far, this has been working for me.

What framework access sensitive user data that need NSBluetoothPeripheralUsageDescription key

I have gotten the following message from App Store Connect when trying to upload a new version...
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 NSBluetoothPeripheralUsageDescription 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.
But I do not use bluetooth anywhere in the app (no bluetooth code).
Here are the frameworks I use:
CoreText, QuartzCore, CoreLocation, CoreGraphics, Foundation, UIKit, StoreKit, CoreData, MapKit
Any advice?
Open Info Plist file and press on + sign add new key in info.plist of your project and add this NSBluetoothPeripheralUsageDescription and write value "Explain the reasons for Bluetooth".
FacebookSDK is scanning Bluetooth since v 4.33. This is the description I have picked.
Facebook-SDK v4.34 contains Places Kit which contains Bluetooth scanning. This app isn't scanning/using Bluetooth at all.

.Net Core: what is the best version to use? SDK 2.1.301 or Runtime 2.1.1

what is the best one to work in .net core? SDK 2.1.301 or Runtime 2.1.1?
I am trying to create a webapi with dotnet, I run dotnet and set http://localhost:5000/api/values/get?Id=1 and fails telling me page not found
I don't know if it is the version of dotnet I installed, I used SDK.
The URL is wrong. It should be http://localhost:5000/api/values/1. That's specified in the controller method itself with a routing attribute :
The SDK inlcudes the runtime so there's no reason to worry about order of installation.
The SDK contains the tools and libraries needed to create and build a project, like dotnet new and dotnet build. It runs on top of the runtime, it doesn't provide its own.
// GET api/values/5
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
This means that the Get action will be called in response to the GET verb and the id parameter will be retrieved from the URL itself.
The runtime contains only the parts that run a program.
UPDATE
The URL just works with the default Web API template. To verify :
Create a new folder
Run dotnet new webapi to create a new Web API project
Run dotnet build to build it and then dotnet run
Paste http://localhost:5000/api/values/1 in any browser.
The response will be
value
UPDATE 2
Postman also works, once SSL certificate verification in Settings > General is disabled.
The Web API template comes with HTTPS preconfigured and works with a self-signed certificate. Calls to http://localhost:5000 will be redirected to https://localhost:5001.
In terms of the framework, there is no difference if you use SDK or runtime. The first one is designed for development, while the latter one for production environments.
Issue comes out from your project, routing for e.g., but difficult to say once you need to share more details. Mentioned framework variants are irrelevant here.

Need to tell users when update occurs

I want to notify all the app users to update the app (through a popup in the app itself) whenever there is a new version deployed in the stores. Can someone suggest the best way to do that?
Luckily, we do have solution for iOS app store
string url = "http://itunes.apple.com/lookup?bundleId=com.xxx.xxxxx";
HttpClient httpClient = new HttpClient();
Task<string> jsonString = httpClient.GetStringAsync(string.Format(
var lookup = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString.Result);
But Now I need to get the current version of App from Google Play Store?
Let's say you want to notify the users about a new version of the app every time they open the application, then you should just trigger a simple GET call to retrieve the latest version info or use a third party lib to act accordingly.
0 cost simple solutions
One option would be to ask the API (if there is any) if a new version is available - basically delegate the problem to someone else. If there is no backend the app could do the check itself. There are different options from having a simple txt file hosted somewhere with the latest app version to scraping App Store and Play Store for the current published version of the app.
Existing solutions
https://appgrades.io/
https://github.com/ArtSabintsev/Siren
Use Push Notifications to notify your users
You will find more if you google it
Platform specific solutions
For iStuff (Apple) you could use iTunes Search API as mentioned here
Other platforms may have their own APIs
Depends on the specific case you can decide what will work better for you.
P.S.: Be sure to handle the versioning correctly by bumping the app version on each release.

Resources