| | |
| | | } |
| | | } |
| | | if (!TextUtils.isEmpty(registrationID)) { |
| | | UserConfigManage.getInstance().setRegistrationID(registrationID); |
| | | UserConfigManage.getInstance().Save(); |
| | | // UserConfigManage.getInstance().setRegistrationID(registrationID); |
| | | // UserConfigManage.getInstance().Save(); |
| | | String finalRegistrationID = registrationID; |
| | | HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String pushId) { |
| | | |
| | | if (!TextUtils.isEmpty(pushId)) { |
| | | UserConfigManage.getInstance().setRegistrationID(finalRegistrationID); |
| | | UserConfigManage.getInstance().setPushId(pushId); |
| | | UserConfigManage.getInstance().Save(); |
| | | } |
| | |
| | | this.notificationSet(); |
| | | //ACCESS_FINE_LOCATION 允许使用GPS定位 |
| | | //ACCESS_COARSE_LOCATION 允许使用WIFI热点或基站来获取粗略的定位 |
| | | // String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); |
| | | // if (ary.length > 0) { |
| | | // this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); |
| | | // } else { |
| | | // locationUpdates(); |
| | | // } |
| | | String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); |
| | | if (ary.length > 0) { |
| | | this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); |
| | | } else { |
| | | locationUpdates(); |
| | | } |
| | | } |
| | | |
| | | @Override |