Files
mattermost-mobile/app/utils/push_proxy.ts
Daniel Espino García 7e80843092 [Gekidou] [MM-41837] Add verification for push proxy and related interface (#6192)
* Add verification for push proxy and related interface

* Fix lint and extract i18n

* Be specific about undefined equalities.

* Fix test

* Address feedback

* Fix long server names styles

* Fix tests and typo
2022-05-09 11:41:16 +02:00

38 lines
1.4 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {IntlShape} from 'react-intl';
import {Alert} from 'react-native';
export function alertPushProxyError(intl: IntlShape) {
Alert.alert(
intl.formatMessage({
id: 'alert.push_proxy_error.title',
defaultMessage: 'Notifications cannot be received from this server',
}),
intl.formatMessage({
id: 'alert.push_proxy_error.description',
defaultMessage: 'Due to the configuration for this server, notifications cannot be received in the mobile app. Contact your system admin for more information.',
}),
[{
text: intl.formatMessage({id: 'alert.push_proxy.button', defaultMessage: 'Okay'}),
}],
);
}
export function alertPushProxyUnknown(intl: IntlShape) {
Alert.alert(
intl.formatMessage({
id: 'alert.push_proxy_unknown.title',
defaultMessage: 'Notifications could not be received from this server',
}),
intl.formatMessage({
id: 'alert.push_proxy_unknown.description',
defaultMessage: 'This server was unable to receive push notifications for an unknown reason. This will be attempted again next time you connect.',
}),
[{
text: intl.formatMessage({id: 'alert.push_proxy.button', defaultMessage: 'Okay'}),
}],
);
}