includable / react-native-check-version Goto Github PK
View Code? Open in Web Editor NEW🥕 Get the latest version of your app.
Home Page: https://flexible.agency
License: MIT License
🥕 Get the latest version of your app.
Home Page: https://flexible.agency
License: MIT License
Get
Require cycle: node_modules/semver/classes/comparator.js -> node_modules/semver/classes/range.js -> node_modules/semver/classes/comparator.js
Possible fix ?:
npm/node-semver#381
I'm just trying to better understand what is the advantage of having a web service
to help the react-native-check-version package. Thanks in advance 😄
I am getting the following return/error:
{
"bundleId": "xxxxx",
"country": "us",
"error": [TypeError: null is not an object (evaluating 'res.data.match(/\[\[\[['"]((\d+\.)+\d+)['"]\]\],/)[1]')],
"lastChecked": "2022-10-11T21:09:44.941Z",
"needsUpdate": false,
"notes": "",
"platform": "android",
"url": null,
"version": null,
}
And it seems that the Play Store HTML structure has changed.
The following PR is my suggestion to fix it:
#45
const version = await checkVersion({
bundleId:'africa.xxx.xx',
currentVersion:'1.0',
});
// currentVersion 1.0.2 , picking correctly from play Store
console.log(version.needsUpdate) // false
Updated this.appVersion = await checkVersion(); fail.
Something was used in this method that stopped a super critical application.
The app is crashing
Help me
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-check-version/src/versions.js b/node_modules/react-native-check-version/src/versions.js
index e69c00f..fc83676 100644
--- a/node_modules/react-native-check-version/src/versions.js
+++ b/node_modules/react-native-check-version/src/versions.js
@@ -1,7 +1,10 @@
-import semver from "semver";
+const semverParse = require('semver/functions/parse');
+const semverCoerse = require('semver/functions/coerce');
+const semverEq = require('semver/functions/eq');
+const semverLt = require('semver/functions/lt');
export const parseVersion = (version) => {
- return semver.parse(semver.coerce(version), true);
+ return semverParse(semverCoerse(version), true);
};
export const diffLoose = (version1, version2) => {
@@ -11,7 +14,7 @@ export const diffLoose = (version1, version2) => {
const v1 = parseVersion(version1);
const v2 = parseVersion(version2);
- if (semver.lt(v2, v1) || semver.eq(v1, v2, true)) {
+ if (semverLt(v2, v1) || semverEq(v1, v2, true)) {
return null;
}
This issue body was partially generated by patch-package.
"react-native-check-version": "^1.1.1",
"react-native": "0.66.5",
{ platform: 'android',
bundleId: 'com.tntmobile',
version: null,
needsUpdate: false,
notes: '',
url: null,
lastChecked: '2023-05-28T12:37:39.902Z',
country: 'fr',
error: [TypeError: Cannot convert null value to object] }
in node modules here is the issue
const text = await res.text();
const version = text.match(/[[['"['"]]],/)[1];
getting null while applying the regex
Hello,
been wondering, does this library supports AppGallerConnect (Huawei store) published applications?
Thanks in advance!
Currently how can i check my current app version? when i am trying through DeviceInfo.getVersion() its retrieve the build version.
Hello,
CheckVersion is returning the following error on a Samsung device today:
{"error": "Invalid time value"}
Is this due to daylight saving time change today?
error node_modules/react-native-check-version/index.js: # could not be cloned.
Error: # could not be cloned.
at Object.serialize (v8.js:283:7)
at _default (/Users/flavio/Documents/Lavori/boxshop/boxshopW/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34)
at normalizeFile (/Users/flavio/Documents/Lavori/boxshop/boxshopW/node_modules/@babel/core/lib/transformation/normalize-file.js:79:36)
at normalizeFile.next ()
at run (/Users/flavio/Documents/Lavori/boxshop/boxshopW/node_modules/@babel/core/lib/transformation/index.js:29:50)
at run.next ()
at /Users/flavio/Documents/Lavori/boxshop/boxshopW/node_modules/@babel/core/lib/transform-ast.js:26:41
at Generator.next ()
at evaluateSync (/Users/flavio/Documents/Lavori/boxshop/boxshopW/node_modules/@babel/core/node_modules/gensync/index.js:251:28)
info Run CLI with --verbose flag for more details.
Command /bin/sh failed with exit code 1
Hello,
Does the check also work for internal version numbers such as Android versionCode and iOS build number ?
If I release a 2.0.0 version with versionCode 100, can I know if there is a update of version 2.0.0 with versionCode 101 ?
My app has been placed in App Store, and http://itunes.apple.com/lookup?lang=en&bundleId=com.instpower.global&country=us
is 2.0.0(is latest), but https://check-version.flexible.agency/ios/com.instpower.global/1.4.3?country=us&cn=1
still return 1.4.3
Hi guys, this package looks pretty amazing! I'm wondering how you guys handle Android rollouts? If I use 20% rollout as a default, is it just a 1/5 chance that your server will see the updated version? And is it possible that someone who is in a region that hasn't had the app rolled out to them yet will get a message that the app is available, when in fact it isn't available for them yet?
I have a app that is still in internal testing and not for public right now will this package work with that as well?
Hello.
Any ideas, is there would be a possibility to get latest version of an android app from google play, which is closed track (alpha) release only?
Basically, it's accessible only by people granted based on email.
So maybe if there would be a configuration option like email/password OR some google API token (no idea how these works) it could be accessed?
Thanks
I updated my appstore app with a new version (1.1.6)
call the api with the current version 1.1.5
https://check-version.flexible.agency/ios/com.pennstate.wwyc/1.1.5?country=us
always return with version 1.1.5
Looking through the server code "utils.js"
const axios = require("axios");
const cache = {}
const lookupVersion = async(platform, bundleId, country = 'us') => {
const key = `${platform}.${bundleId}`;
let res = cache[key];
if (res) {
return res;
}
Apparently, it is always returning the result with platform and bundleId. Is this expected, that the server will only register the app info once?
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected]
for the project I'm working on.
Hi! Just proposing a minor change the to TS interface to help handle errors when the app doesn't exist
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-check-version/index.d.ts b/node_modules/react-native-check-version/index.d.ts
index 20d4295..453f93b 100644
--- a/node_modules/react-native-check-version/index.d.ts
+++ b/node_modules/react-native-check-version/index.d.ts
@@ -21,6 +21,7 @@ export interface CheckVersionResponse {
bundleId?: string;
lastChecked?: string;
country?: string;
+ error?: Error;
}
declare const checkVersion: (
This issue body was partially generated by patch-package.
When using typescript the property country is missing from the CheckVersionOptions interface
checkVersion({
country: 'us' // throw: Object literal may only specify known properties, and 'country' does not exist in type 'CheckVersionOptions'
});
import { checkVersion } from "react-native-check-version";
const version = await checkVersion();
console.log("Got version info:", version);
if (version.needsUpdate) {
console.log(`App has a ${version.updateType} update pending.`);
}
RESULT:
Got version info: {"bundleId": null, "country": "us", "error": [Error: App with bundle ID "null" not found in Google Play.], "lastChecked": "2024-04-04T03:59:10.402Z", "needsUpdate": false, "notes": "", "platform": "android", "url": null, "version": null}
🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.
Hi guys. Thanks for the awesome library.
I have no probs with it on iOS, however on Android i'm getting this error:
Got version info:
error: "Invalid Version: //play.google.com/">"
error: "Invalid Version: //play.google.com/">
I tried that with debug and release versions.
Is it a bug or i just need to test it on the app download from the market?
Thanks.
Hi, On Android 10 I am getting version null and error "Error: Request failed with status code 403". Adding 'sec-fetch-site': 'same-origin' to headers solves the problem. Could you check it?
This is more of a question then issue but title. App Store says it may take 24hours.
Does the check retrieves last beta version by default, or only public versions ? Is there a way to specify taking betas into account ?
Hi again. I pushed an update to the play store and after 2 hours the updated data still didn't reach the server. It was still showing the data from the previous version.
I wanted to use this lib to force update the app but with this issue it is impossible.
Check version is returning “needsUpdate”: false, “url”: null, and “version”: null.
On further investigation, I found that the regex match is not working with the new google play UI changes.
Please update the library accordingly.
I'm getting the following error when trying to open version.url with
Linking.openURL(version.url)
Safari cannot open the page because the address is invalid
My version object looks like this:
{"bundleId": "com.dahlsjoo.shinner", "country": "us", "lastChecked": "2021-07-16T00:05:22.581Z", "needsUpdate": false, "notes": "Bug fixes", "platform": "ios", "released": "2021-07-01T18:19:45Z", "updateType": null, "url": "https://apps.apple.com/us/app/shinner-skate-spots-videos/id1476836516?uo=4", "version": "1.2.4"}
Hi, a couple of days ago Google introduced a new design to their Google Play Store, and it broke another similar package that allows getting the currently available version from the store. Did you do any changes to the match of the "Current Version" to adjust for the design changes? If so, could you provide does changes or the whole code to get the store version? Because I would prefer to implement it on the mobile side instead of reaching to a separate backend.
When the new version available on play store and from app we redirect to the play store instead of showing update button it shows open button.
this.appVersion = await checkVersion();
The app crashes when I called this method, I think it is due to your updates 3 hours ago.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.