MCPcopy Index your code
hub / github.com/reactnativecn/react-native-update / constructor

Method constructor

src/client.ts:133–154  ·  view source on GitHub ↗
(options: ClientOptions, clientType?: 'Pushy' | 'Cresc')

Source from the content-addressed store, hash-verified

131 })();
132
133 constructor(options: ClientOptions, clientType?: 'Pushy' | 'Cresc') {
134 this.clientType = clientType || 'Pushy';
135 this.options.server = cloneServerConfig(SERVER_PRESETS[this.clientType]);
136
137 i18n.setLocale(options.locale ?? this.clientType === 'Pushy' ? 'zh' : 'en');
138
139 if (Platform.OS === 'ios' || Platform.OS === 'android') {
140 if (!options.appKey) {
141 throw Error(i18n.t('error_appkey_required'));
142 }
143 }
144
145 this.setOptions(options);
146 if (isRolledBack) {
147 this.report({
148 type: 'rollback',
149 data: {
150 rolledBackVersion,
151 },
152 });
153 }
154 }
155
156 setOptions = (options: Partial<ClientOptions>) => {
157 for (const [key, value] of Object.entries(options)) {

Callers

nothing calls this directly

Calls 3

cloneServerConfigFunction · 0.85
setLocaleMethod · 0.80
tMethod · 0.80

Tested by

no test coverage detected