Is there a way to pass parameters to the marketplace installer for an app
when providing a user on a mobile, a link to an android application via a web page, it is possible for params from 开发者_如何学JAVAthe url to be passed to the app being installed.
I'm guessing the answer is no - but it doesn't help to ask.
The reasoning being that it would be handy for some situations to have a generic app that pulls config information from the referrer.
This is possible only for the use case of referral tracking, using the Analytics Tracking for Mobile Apps SDK. The documentation will have more details, but the basic steps are:
- Create referral-tagged market deep link URLs using this tool.
- Use these links on web sites that you want to track referrals from.
- When a user downloads your app using the referral link, the referral info is stored.
- Upon first run of your app, use the Analytics SDK to track a 'first-run event' using
trackEvent
. If your app was downloaded with referral info, this event (and all future event and pageview tracking) will be tagged with the referral info. - In Analytics, you'll be able to filter these events on campaign/referral info.
I think you can change a bit the scenario of the anlytics referral tracking to pass parameters to your app during installation if you need...
You have to declare a custom receiver for com.android.vending.INSTALL_REFERRER in the custom receiver parse the url from the market.
If you want the analytics to work as well, is better if you extend the com.google.android.apps.analytics.AnalyticsReceiver and call the super.onReceive
There are two parameters that are optional in the referral the campaign term and the campaign content so I will put there the information you want to pass
I worked a bit on this and I wrote a post where I explain even how to test it : http://www.dev-articles.com/article/Analytics-referral-tracking-for-Android-447001
精彩评论