この質問は、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