mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 10:21:37 +08:00
fix clientType
This commit is contained in:
@@ -82,13 +82,13 @@ export class Pushy {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
constructor(options: ClientOptions) {
|
constructor(options: ClientOptions, clientType?: 'Pushy' | 'Cresc') {
|
||||||
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
||||||
if (!options.appKey) {
|
if (!options.appKey) {
|
||||||
throw new Error('appKey is required');
|
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.options.server = SERVER_PRESETS[this.clientType];
|
||||||
this.setOptions(options);
|
this.setOptions(options);
|
||||||
if (isRolledBack) {
|
if (isRolledBack) {
|
||||||
@@ -521,4 +521,8 @@ export class Pushy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for international users
|
// for international users
|
||||||
export class Cresc extends Pushy {}
|
export class Cresc extends Pushy {
|
||||||
|
constructor(options: ClientOptions) {
|
||||||
|
super(options, 'Cresc');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user