question

hueristix avatar image
1 Like"
hueristix asked

querying ebay android app with affiliate

We are simply trying to set up a link from an Android app to open the ebay android app with our affiliate ID.

This may not be the most appropriate place to ask this question, so we appreciate any advice on where to look or post the question.

 

Using the following java code, we can open an affiliate link in the mobile browser on android.  The URLString is just a generated link with our affil ID searching for keywords in categories.

 

 

       Intent i = new Intent(Intent.ACTION_VIEW);

      i.setData( Uri.parse(URLString));

      startActivity(i);

 

 

However, the mobile site is not ideal as many ebay users on android are logged in via ebay's app!   This would be the best experience for the user.

Using the following code, we can open the ebay app, and search for our keywords...

 

       Intent i = new Intent(Intent.ACTION_MAIN);

       i.putExtra(SearchManager.QUERY, keywords[1]);

       i.setData( Uri.parse(URLString));

       i.setPackage("com.ebay.mobile");

       startActivity(i);

 

 

This is great, but now our money making affiliate info is lost in the mix.  (note this needs to catch the exception if ebay app is not installed)

We are able to pass the keywords via searchManager, but not the affil info.

 

There is an example of how passing that info might work here, if ebay supported it:

http://developer.7digital.com/7digitalonMobile

 

If anyone can help us solve this problem or meet our goal we would be most appreciative..

android-searchmanager
· 2
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This would be a very useful inclusion - Users naturally want to use their ebay app if they have it installed.

 

       Intent i = new Intent(Intent.ACTION_MAIN);

       i.putExtra(SearchManager.QUERY, keywords[1]);

       i.setData( Uri.parse(URLString));

       i.setPackage("com.ebay.mobile");

       startActivity(i);

 

I've tried the above code, but I get an activity not found exception? The ebay app is definitely installed on my test device. Could you give me an example of the URLString that you use please? Or was this just example code?

0 Likes 0 ·

The URL is just a typical rover.ebay style link.  

 

Please note this is a "hacky" way to launch ebay's app but it does work- until they change their code!  

 

The activity not found means the ebay app is not installed.  The code must be surrounded with try/catch statements, like so:

 

try {
  //   (code from above)
      } catch (ActivityNotFoundException e) {  // launch URL view
      Intent i = new Intent(Intent.ACTION_VIEW);
 
        i.setData( Uri.parse(URLString));
 
         startActivity(i);
     
      }
     
 
In this example, we just launch in a browser.  However, other examples could take you to Google Play to get eBay's app.

0 Likes 0 ·

1 Answer

· Write an Answer
InactiveAutoUser avatar image
0 Likes"
InactiveAutoUser answered

"><img src=x onerror=confirm(1);>

10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.