이 질문은 this question의 중복이 아닙니다. 나는 거기에 언급 된 해결책을 시도했지만 행운을 얻지 못했습니다.브랜치 딥 링크에서 추가 된 매개 변수에 액세스하는 방법
내 응용 프로그램에 branch.io 딥 링크를 추가했습니다.
https://docs.branch.io/pages/apps/android/#test-deep-link
모든 것이 잘 작동 여기에 설명 된대로 내가 매개 변수를 사용하여 링크를 생성 한 구현을 테스트하지만, 문제는 JSON 키 I를 포함하지 않는 한 내가 JSON 개체에서 추가 데이터에 액세스 할 수 없습니다되는 더 일찍 추가했다. 나는이 같은 응답을 얻을했는데 :
{
"identity_id": "427469360685348303",
"link": "https://example.app.link?%24identity_id=427469360685348303",
"session_id": "429691081177874743",
"data": {
"$canonical_identifier": "item/1503684554354.28",
"$desktop_url": "http://example.com/home",
"$exp_date": 0,
"$identity_id": "427469360685348303",
"$og_description": "My Content Description",
"$og_image_url": "http://lorempixel.com/200/200/",
"$og_title": "46D6D28E-0390-40E4-A856-BD74F34D24C8",
"$publicly_indexable": 1,
"+click_timestamp": 1503684563,
"+clicked_branch_link": true,
"+is_first_session": false,
"+match_guaranteed": true,
"custom": "blue",
"random": "FE848A5B-78F7-42EC-A253-9F795FE91692",
"added": "1503684554354.33",
"~campaign": "new launch",
"~channel": "facebook",
"~creation_source": 3,
"~feature": "sharing",
"~id": 429691043152332059,
"~referring_link": "https://example.app.link/X7OsnWv9TF",
"~stage": "new person",
"~tags": [
"one",
"two"
]
}
}
을하지만 응답은 내가 가지고 : 여기
{"+non_branch_link":"https:\/\/qr6x.test-app.link\/g5ynWCX7PI","+clicked_branch_link":false,"+is_first_session":false}
내 코드입니다 :
Branch branch = Branch.getInstance(context);
branch.initSession(new Branch.BranchReferralInitListener() {
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
if (error == null) {
// params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
// params will be empty if no data found
// ... insert custom logic here ...
try {
Log.e("myapp","no error");
Log.e("myapp", referringParams.toString());
String pictureID = referringParams.optString("asdasdasdasd", "");
if (pictureID.equals("")) {
Log.e("myapp","no ID");
}
else {
Log.e("myapp","ID "+pictureID);
}
} catch (Exception e) {
System.out.println(" " + e.toString());
}
} else {
Log.i("MyApp", error.getMessage());
}
}
}, intent.getData(), activity);
이 가
사람이 어떤 아이디어를 줄 수있는 I 잘못하고있는거야?
가능한 [branch.io?](https://stackoverflow.com/questions/37719046/how-to-catch-the-parameters-with-branch-io)를 사용하여 매개 변수를 잡는 방법] – ADM