1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-19 01:00:39 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

fix: new version

This commit is contained in:
sunnylqm
2024-01-21 14:41:06 +08:00
parent e5405b4977
commit 36533d43c4
7 changed files with 244 additions and 207 deletions

View File

@@ -41,17 +41,22 @@ export class Pushy {
marked = false;
applyingUpdate = false;
version = cInfo.pushy;
constructor(options: PushyOptions) {
if (!options.appKey) {
throw new Error('appKey is required');
}
this.setOptions(options);
}
setOptions = (options: Partial<PushyOptions>) => {
for (const [key, value] of Object.entries(options)) {
if (value !== undefined) {
this.options[key] = value;
}
}
}
};
getCheckUrl = (endpoint: string = this.options.server!.main) => {
return `${endpoint}/checkUpdate/${this.options.appKey}`;