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

fix clientType

This commit is contained in:
sunnylqm
2025-03-05 16:52:13 +08:00
parent 020e4f9239
commit 37739940ab

View File

@@ -82,13 +82,13 @@ export class Pushy {
};
})();
constructor(options: ClientOptions) {
constructor(options: ClientOptions, clientType?: 'Pushy' | 'Cresc') {
if (Platform.OS === 'ios' || Platform.OS === 'android') {
if (!options.appKey) {
throw new Error('appKey is required');
}
}
this.clientType = new.target.name as 'Pushy' | 'Cresc';
this.clientType = clientType || 'Pushy';
this.options.server = SERVER_PRESETS[this.clientType];
this.setOptions(options);
if (isRolledBack) {
@@ -521,4 +521,8 @@ export class Pushy {
}
// for international users
export class Cresc extends Pushy {}
export class Cresc extends Pushy {
constructor(options: ClientOptions) {
super(options, 'Cresc');
}
}