Kyri33
Kyri33

Reputation: 599

codename one. How to share a link to your app.

What I want to achieve here is similar to what most apps do, specifically like Youtube. If I share a video on youtube the user gets a link to the video. When the link is clicked the user is automatically taken to the video in the Youtube app (if the user has the app). I want that sort of functionality. My app has different stores on it and information about the store. I want the user to be able to "Share" a store via Whatsapp, sms etc so then when the receiver clicks on the shared link they are automatically taken to that specific store's page INSIDE my app. And if they do not have the app the link must take them to my app's page in the app store to allow them to download it. How do I achieve this in codename one. I looked at the share functionality in the developer doc and the How To section and that only shows me how to share text or images. Not a link to my app.

Upvotes: 1

Views: 616

Answers (2)

Kyri33
Kyri33

Reputation: 599

The correct answer to this question was actually URL intercepting. http://www.codenameone.com/blog/intercepting-urls-on-ios-android.html You share a url from your app to an external application. When the user opens that lick in an external application the user is automatically taken to your app if your app intercepts it.

Upvotes: 1

Shai Almog
Shai Almog

Reputation: 52760

You can use the ShareButton or it's underlying native share API call (notice this behaves differently on devices as this relies on native functionality).

To share one URL that works on all platforms you need server side code as we have no way of knowing if the guy who will click the link has the same device as you have.

How to make QR code for BOTH Android Market and App Store answers that although it discusses QR codes this is applicable to links as well e.g. http://onelink.to/ looks like it could solve that although I haven't tried their service.

Upvotes: 1

Related Questions