From aad718c7147c977a0b0f9e7d44f4b3c8f31de46d Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 14 May 2020 03:43:08 +0100 Subject: [PATCH] purchase_uri for free content --- .../main/java/io/lbry/browser/FileViewActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/io/lbry/browser/FileViewActivity.java b/app/src/main/java/io/lbry/browser/FileViewActivity.java index 1889e41c..e24fb92c 100644 --- a/app/src/main/java/io/lbry/browser/FileViewActivity.java +++ b/app/src/main/java/io/lbry/browser/FileViewActivity.java @@ -944,6 +944,9 @@ public class FileViewActivity extends AppCompatActivity { public void onClick(DialogInterface dialogInterface, int i) { Bundle bundle = new Bundle(); bundle.putString("uri", currentUrl); + bundle.putBoolean("paid", true); + bundle.putDouble("amount", cost); + bundle.putString("currency", fee.getCurrency()); LbryAnalytics.logEvent(LbryAnalytics.EVENT_PURCHASE_URI, bundle); findViewById(R.id.file_view_main_action_button).setVisibility(View.INVISIBLE); @@ -989,6 +992,13 @@ public class FileViewActivity extends AppCompatActivity { public void onSuccess(LbryFile file, boolean saveFile) { // queue the download if (claim != null) { + if (claim.isFree()) { + // paid is handled differently + Bundle bundle = new Bundle(); + bundle.putString("uri", currentUrl); + LbryAnalytics.logEvent(LbryAnalytics.EVENT_PURCHASE_URI, bundle); + } + if (!claim.isPlayable()) { logFileView(claim.getPermanentUrl(), 0); }