0% found this document useful (0 votes)
26 views9 pages

Cuelinks SDK - Integration Guide

Best

Uploaded by

Ramana K G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views9 pages

Cuelinks SDK - Integration Guide

Best

Uploaded by

Ramana K G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Cuelinks SDK

Integration Guide
Version: 1.0.3

Integration Guide for Android SDK


Date:​ 11-09-2019

All rights reserved


Important notice: The content in this document is for the use of the intended recipient only. If the recipient is not the intended recipient,
please notify us immediately and remove/delete this document irretrievably from your physical and/ or electronic records.

The content of this document including design, text, graphic and selection and arrangement thereof, is the property of Parity Cube Pvt Ltd.
The content in this document is copyrighted by Parity Cube Pvt Ltd (© Parity Cube Pvt Ltd 2016, all rights reserved) and the information
described herein may be protected by one or more of Parity Cube’s Intellectual Property registrations or pending applications.. Except as
specifically provided otherwise in writing , no part of this document may be reproduced in any form by any means without prior written
authorization of Parity Cube. All rights not expressly granted herein are reserved. Unauthorized use of any content in this document may
violate copyright, trademark and other applicable laws, including confidentiality obligations and could result in criminal or civil penalties. All
copyright, trademark, and other intellectual property and proprietary rights in this document and in the software, text, graphics, images,
and all other materials originated or used by Parity Cube at document are the exclusive property of Parity Cube and its licensors. Content in
this document is solely for informational purposes ; it is not intended as and does not constitute legal or tax advice. Any use of this
document and the information described herein will be governed by these terms and conditions. By viewing, downloading or otherwise
copying this document, you agree that you have read, understood, and will comply with all the terms and conditions set forth herein.

www.cuelinks.com
INTEGRATION GUIDE FOR CUELINKS SDK

Table of Contents

1. Installation Steps .…………… 3


2. Additional Settings ….………… 7
a. Passing a SubId ….………… 7
b. Adding Internal Deeplink URLs ….………… 8
c. Overriding the default behaviour ….………… 8
3. Demo Project ….………… 9

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 2/9


INTEGRATION GUIDE FOR CUELINKS SDK

1. Installation Steps

Step 1

Add the following in your app gradle file : ​compile

implementation ​'com.cuelinks.sdk:link-kit:1.0.3'

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 3/9


INTEGRATION GUIDE FOR CUELINKS SDK

Step 2

Configure your Channel Id (mandatory) in the AndroidManifest File.

Provide your ​channelId ​(mandatory) in AndroidManifest file as :

<​meta-data ​android​:name=​"com.cuelinks.channelId" ​android​:value=​"XXXXX”​/>

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 4/9


INTEGRATION GUIDE FOR CUELINKS SDK

Step 3

Initialise the sdk in your app Application file as

@Override
public void ​onCreate() {
super​.onCreate();
Cuelinks.​initialize​(​this​);
}

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 5/9


INTEGRATION GUIDE FOR CUELINKS SDK

Step 4

Now you are ready to use the SDK , wherever you want to convert your link you can use the following
in your TextView, default behaviour is if you want to redirect all the links to browser.

Adding affiliate links in normal text:

In the activity layout file add

android:autoLink="all"

textView​.setMovementMethod(CuelinkMovementMethod.​getInstance​(MainAct
ivity.​this​));

Adding affiliate links in html text :

​ ​HtmlText​,
textView​.setText(CuelinkSpan.​affiliateHrefUrlsFromHtml(
textView​, MainActivity.​this​));

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 6/9


INTEGRATION GUIDE FOR CUELINKS SDK

2. Additional Settings

1. Passing Up to 5 SubIds (Optional)

Configuring subId in your affiliate links also possible with default and dynamic subId configurations.
You can configure upto 5 comma separated ​subId​ in the AndroidManifest

<​meta-data ​android​:name=​"com.cuelinks.subId"
android​:value=​"subId1, subId2, SubId3, subId4, subId5”​/>

pass it dynamically in with the links.

Dynamic subId in normal text

textView​.setMovementMethod(CuelinkMovementMethod.​getInstance​(MainAct
ivity.​this​, subId1,subId2, SubId3, subId4, subId5));

Dynamic subId in html text

textView​.setText(CuelinkSpan.​affiliateHrefUrlsFromHtml( ​ ​HtmlText​,
textView​, MainActivity.​this​,subId1,subId2,SubId3,subId4,subId5));

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 7/9


INTEGRATION GUIDE FOR CUELINKS SDK

2. Adding Internal Deeplink URLs

Configure the base URL of your internal deeplink URL so that the SDK doesn’t affiliate those URLs.
You can configure the ​internalUrl ​(optional) for in the AndroidManifest

<​meta-data ​android​:name=​"com.cuelinks.internalUrl"
android​:value=​"example.com”​/>

3. Overriding the default behaviour

If you wish to override the default method with a custom method:

Implement interface ​CuelinkListener​ and override method ​openUrl​ in it, as per your
requirements.
Note: Here the url will be affiliated already unless configured as internalUrl in Android Manifest file.

@Override
public void ​openUrl(String url, Context context) {
Your code goes here..
}

And pass the reference of your listener as :

Overriding affiliate links in normal text

textView​.setMovementMethod(CuelinkMovementMethod.​getInstance​(MainAct
ivity.​this, (CuelinkListener)​MainActivity.​this​));

Overriding affiliate links in html text

textView​.setText(CuelinkSpan.​affiliateHrefUrlsFromHtml( ​ ​HtmlText​,
textView​, MainActivity.​this, (CuelinkListener)​MainActivity.​this​));

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 8/9


INTEGRATION GUIDE FOR CUELINKS SDK

3. Demo Project

For a better understanding of the installation and working of Cuelinks SDK, you can refer the demo
project mentioned below:

1. Clone project as ' ​git clone ​[email protected]:cuelinks/CuelinksSDKDemo.git​ '


2. Change ​channelId​, i​ nternalUrl​ & ​subId​ in AndroidManifest file and observe the affiliated urls.

©2019 Parity Cube Pvt. Ltd. All Rights Reserved 9/9

You might also like