Commit 07b299e2 by 万齐军

Merge branch 'feat/qj/im_apns' into 'd/v4.3.92'

feature: im加apns

See merge request app_android_lib/YDL-Component!5
parents a5d2d185 9c0764fa
......@@ -31,6 +31,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.SPUtils;
......@@ -73,6 +74,8 @@ import com.yidianling.uikit.custom.widget.SafeHelpRemindDialog;
import com.yidianling.user.api.service.IUserService;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -649,12 +652,25 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
fillHwPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillOppoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillVivoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
payload.put("sessionId", NimUIKit.getAccount());
payload.put("sessionType", container.sessionType.getValue());
fillApnsPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
msg.setPushPayload(payload);
return msg;
}
private void fillApnsPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
try {
Map<String, Object> apns = new HashMap<>();
apns.put("toUid", sessionId);
apns.put("sessionType", sessionType);
apns.put("chatType", 1);
String json = JSON.toJSONString(apns);
String encode = URLEncoder.encode(json, "UTF-8");
String finalUrl = "ydl-user://chat/private?params=" + encode;
pushPayload.put("route_ios", finalUrl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
private void fillHwPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
//华为
Intent hwIntent = new Intent(Intent.ACTION_VIEW);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment