Skip to content

Commit

Permalink
极光推送
Browse files Browse the repository at this point in the history
  • Loading branch information
shengyao authored and shengyao committed Jan 12, 2019
1 parent 37f6ad0 commit 4713acf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"/Users/Aaron/Desktop/gitlab/Mozi/index.js":{"size":129,"mtime":1547124041444,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/actions/home.js":{"size":572,"mtime":1547124041535,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/actions/home.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/constants/actionTypes.js":{"size":154,"mtime":1547124041535,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/constants/actionTypes.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/constants/urls.js":{"size":168,"mtime":1547124041535,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/constants/urls.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/base.js":{"size":347,"mtime":1547124041536,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/base.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/home.js":{"size":381,"mtime":1547124041536,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/home.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/index.js":{"size":182,"mtime":1547124041536,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/nav.js":{"size":195,"mtime":1547124041536,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/reducers/nav.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/selectors/home.js":{"size":472,"mtime":1547124077708,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/selectors/home.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/store/configureStore.js":{"size":803,"mtime":1547124041537,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/store/configureStore.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/app/store/connect.js":{"size":477,"mtime":1547124077708,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/app/store/connect.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/cn.js":{"size":3926,"mtime":1547124041538,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/cn.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/en.js":{"size":3761,"mtime":1547124041538,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/en.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/index.js":{"size":287,"mtime":1547124041539,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/i18n/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/utils/request.js":{"size":2143,"mtime":1547124041539,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/commons/utils/request.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/Icon/index.js":{"size":419,"mtime":1547124077709,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/Icon/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/index.js":{"size":238,"mtime":1547124041541,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListItem/index.js":{"size":1599,"mtime":1547124041540,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListItem/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListItem/item.style.js":{"size":1016,"mtime":1547124041540,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListItem/item.style.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListParagraph/index.js":{"size":1334,"mtime":1547124041541,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/ListParagraph/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/components/NavigationButton/index.js":{"size":1179,"mtime":1547124041541,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/components/NavigationButton/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/config.js":{"size":2767,"mtime":1547124077709,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/config.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/cheng/CustomPlaceholder.js":{"size":350,"mtime":1547124041542,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/cheng/CustomPlaceholder.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/cheng/index.js":{"size":2601,"mtime":1547124041543,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/cheng/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/back.js":{"size":1281,"mtime":1547124041543,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/back.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/backa.js":{"size":840,"mtime":1547124041543,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/backa.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/web.js":{"size":1137,"mtime":1547124041543,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/demo/web.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/gong/HeaderImageScrollView.js":{"size":7514,"mtime":1547124077710,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/gong/HeaderImageScrollView.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/gong/index.js":{"size":2075,"mtime":1547124041544,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/gong/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/index.js":{"size":1333,"mtime":1547124041545,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/moui/index.js":{"size":967,"mtime":1547124041545,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/moui/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/plug/index.js":{"size":2354,"mtime":1547124041545,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/plug/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/rule/index.js":{"size":596,"mtime":1547124041546,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/mo/rule/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/zi/index.js":{"size":3534,"mtime":1547222800687,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/containers/zi/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/root.js":{"size":684,"mtime":1547124077710,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/root.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/routers/app.js":{"size":924,"mtime":1547124077711,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/routers/app.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Aaron/Desktop/gitlab/Mozi/src/routers/index.js":{"size":461,"mtime":1547124041547,"hashOfConfig":"hrcju5","results":{"filePath":"/Users/Aaron/Desktop/gitlab/Mozi/src/routers/index.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}}}
22 changes: 20 additions & 2 deletions android/app/src/main/java/com/mozi/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,26 @@ protected String getMainComponentName() {
@Override
protected void onCreate(Bundle savedInstanceState) { // 2. 显示启动方法
SplashScreen.show(this);
JPushInterface.init(this);
super.onCreate(savedInstanceState);
JPushInterface.init(this);

}

@Override
protected void onPause() {
super.onPause();
JPushInterface.onPause(this);
}

@Override
protected void onResume() {
super.onResume();
JPushInterface.onResume(this);
}

@Override
protected void onDestroy() {
super.onDestroy();
}


}
12 changes: 6 additions & 6 deletions src/AppNavigationState.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export default class AppNavigationState extends Component {
if (resultCode === 0) { }
});
// 接收自定义消息
// JPushModule.addReceiveCustomMsgListener(message => {
// this.setState({ pushMsg: message, });
// });
JPushModule.addReceiveCustomMsgListener(message => {
this.setState({ pushMsg: message, });
});
// 接收推送通知
// JPushModule.addReceiveNotificationListener(message => {
// console.log(`receive notification: ${message}`);
// });
JPushModule.addReceiveNotificationListener(message => {
console.log(`receive notification: ${message}`);
});
// 打开通知
JPushModule.addReceiveOpenNotificationListener(() => {
console.log('Opening notification!');
Expand Down

0 comments on commit 4713acf

Please sign in to comment.