| | |
| | | * 注册 OPPO RegId |
| | | */ |
| | | public static void registeredOPPOId(Context context) { |
| | | String uid = context.getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", "") + ""; |
| | | // Log.e("eee", "registeredOPPOId-uid: " + uid); |
| | | String registerId = null; |
| | | if (PushManager.getInstance() != null) |
| | | registerId = PushManager.getInstance().getRegisterID(); |
| | | if (!StringUtils.isEmpty(registerId)) |
| | | ShoppingApi.bindOPPOPush(context, uid, registerId, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.bindOPPOPush(context, UserUtil.getUid(ShoppingApplication.application), registerId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | super.onSuccessPerfect(statusCode, headers, jsonObject); |
| | |
| | | * 注册 VIVO RegId |
| | | */ |
| | | public static void registeredVIVORegId(Context context) { |
| | | String uid = context.getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", "") + ""; |
| | | // Log.e("eee", "registeredVIVORegId-uid: " + uid); |
| | | String registerId = null; |
| | | if (PushClient.getInstance(context) != null) |
| | | registerId = PushClient.getInstance(context).getRegId(); |
| | | if (!StringUtils.isEmpty(registerId)) |
| | | ShoppingApi.bindVIVOPush(context, uid, registerId, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.bindVIVOPush(context, UserUtil.getUid(ShoppingApplication.application), registerId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | super.onSuccessPerfect(statusCode, headers, jsonObject); |
| | |
| | | public static void createShareLink(final Context mContext, final GoodsDetail mInfo, String from) { |
| | | final ShapeLoadingDialog pb = new ShapeLoadingDialog.Builder(mContext).build(); |
| | | pb.show(); |
| | | String uid = mContext.getSharedPreferences("user", mContext.MODE_PRIVATE).getString("uid", "0"); |
| | | ShoppingApi.createShareLink(mContext, uid, mInfo.getGoods().getGoodsId(), mInfo.getGoods().getGoodsType() + "", from, null, null, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.createShareLink(mContext, UserUtil.getUid(ShoppingApplication.application), mInfo.getGoods().getGoodsId(), mInfo.getGoods().getGoodsType() + "", from, null, null, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |