Closed Asim-2000 closed 3 years ago
I do not see how the name of the Flutter MethodChannel
is related to the Install Referrer API.
The MethodChannel
is only used for communication between the Flutter app and the native plugin.
The channel name itself is arbitrary. It just has to be the same on the Dart side (your cited code) and the Android side (the link above).
Further, your screenshot shows the documentation of the Play Installer AIDL interface (https://developer.android.com/google/play/installreferrer/igetinstallreferrerservice) which is not used in this plugin.
Instead we use the Play Installer Java/Kotlin library (https://developer.android.com/google/play/installreferrer/library) which makes it easier to work with from Java/Kotlin.
Especially, it does not require us to pass package_name
.
The plugin will only work for you until and unless we change the package name for the caller. Hence, we need to accept it as an argument for the package. and based on the input, we need to give the response.
Following are the details mentioned in the Play Install Referrer API.
And this is the implementation of the Channel:
It should be something like this