mattermost-mobile/app/components/push_notification/index.js
enahum 6324f22095 PLT-5630 Implement push notifications and unread badge on app icon (#338)
* enable ios push notifications

* enable android push notifications

* NOTICE for push notification and message bar

* include message in noty

* re-wording notices

* feedback review
2017-03-13 09:51:21 -04:00

35 lines
1,019 B
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {goToNotification, queueNotification} from 'app/actions/views/root';
import {setDeviceToken} from 'service/actions/general';
import {getUnreads} from 'service/selectors/entities/channels';
import PushNotification from './push_notification';
function mapStateToProps(state, ownProps) {
const {currentId: currentTeamId} = state.entities.teams;
const {currentId: currentChannelId} = state.entities.channels;
return {
...ownProps,
currentTeamId,
currentChannelId,
...getUnreads(state)
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
goToNotification,
queueNotification,
setDeviceToken
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(PushNotification);