Search Unity

not receiving Referrer (App Install Source)

Discussion in 'Android' started by badescuga9, Dec 8, 2014.

  1. badescuga9

    badescuga9

    Joined:
    Dec 11, 2012
    Posts:
    37
    i've placed this in the android manifest:



    this is my java code:
    Code (CSharp):
    1.  
    2.  
    3.         package com.erl.aol.javaReferrerPlugin;
    4.  
    5.     import android.content.BroadcastReceiver;
    6.     import android.content.Context;
    7.     import android.content.Intent;
    8.  
    9.  
    10.         public class PluginClass extends BroadcastReceiver {
    11.          
    12.             static String receivedReferrer = "";
    13.             static String fullPath = "empty";
    14.          
    15.          
    16.          
    17.            @Override
    18.                 public void onReceive(Context context, Intent intent) {
    19.                 String referrer = intent.getStringExtra("referrer");
    20.                 receivedReferrer = referrer;
    21.                 fullPath = "full path found";       // do stuff with the referrer
    22.             }
    23.          
    24.            public static String GetReffererString()
    25.            {
    26.               return receivedReferrer;
    27.            }
    28.          
    29.            public static String HasEnteredOnReceive()
    30.            {
    31.               return fullPath;
    32.            }
    33.          
    34.            public static String TestMethod()
    35.            {
    36.               return "This is a test string. Alex Badescu";
    37.            }
    38.         }
    and i try to simulate a broadcast in adb-shell like this:
    But the command returns :

    > Broadcast completed: result=0

    And i don't get the referrer on my device. Note that the androidmanifest snippet is just a part of the actual manifest and my app bundle id is

    > com.erl.aol

    What am i doing wrong?
     
  2. AleXoNNNe

    AleXoNNNe

    Joined:
    Sep 19, 2016
    Posts:
    18
    I have exactly the same problem now, did you solve it ?