kutt icon indicating copy to clipboard operation
kutt copied to clipboard

Android App

Open abhijithvijayan opened this issue 5 years ago • 37 comments

Is it be useful to build an android app for Kutt?

abhijithvijayan avatar May 11 '19 12:05 abhijithvijayan

Not sure, when was the last time you shortened a link on your phone?

trgwii avatar May 16 '19 20:05 trgwii

@trgwii I use bit.ly app all the time. Click the long url and it says bit.ly and it will automatically shorten and copy to clipboard in the background.

abhijithvijayan avatar May 17 '19 03:05 abhijithvijayan

I liked the idea of having the kutt button alongside copy.

poeti8 avatar Jun 02 '19 09:06 poeti8

@poeti8 I can work on the app.

abhijithvijayan avatar Jun 02 '19 11:06 abhijithvijayan

I liked the idea of having the kutt button alongside copy.

Me too, i think it's a good idea to have one!

Yash-Garg avatar Jun 02 '19 12:06 Yash-Garg

@poeti8 But what about authentication?

I was thinking of forwarding them to the kutt endpoint via the browser and making them copy the generated api key and paste it in the app.

If there was an endpoint that returned the api key(if exist) on POST ing the id and password, it could've been easier.

Does it affect the security if such an endpoint exist ?

abhijithvijayan avatar Jun 05 '19 15:06 abhijithvijayan

How does Bitly do it? I prefer to not create such an endpoint.

poeti8 avatar Jun 10 '19 14:06 poeti8

@poeti8 They use authentication

abhijithvijayan avatar Jun 10 '19 14:06 abhijithvijayan

@abhijithvijayan What's the process? Everytime user wants to shorten the URL or only once?

poeti8 avatar Jun 10 '19 14:06 poeti8

@poeti8 After authentication, as from bit.ly, anyone can copy the long url and click on the bit.ly icon next to cut copy and it will auto shorten and copy the shortened url to clipboard in the background itself.

abhijithvijayan avatar Jun 10 '19 14:06 abhijithvijayan

also opening the app provides option to shorten new urls.

All the shortened urls created with that account will list on the app.

abhijithvijayan avatar Jun 10 '19 14:06 abhijithvijayan

@abhijithvijayan Ok, what's stopping us from implementing this?

poeti8 avatar Jun 10 '19 14:06 poeti8

@poeti8 The authentication and also the listing requires returning all the created urls back to the app via some api call.

I dont know if users will use the api key for the app considering the tedious login on browser and the api creation followup.

abhijithvijayan avatar Jun 10 '19 15:06 abhijithvijayan

We already have an endpoint to return the list of URLs. Also logged in users can generate an API or see the existing one.

What else needs to be done? You need to be specific.

poeti8 avatar Jun 10 '19 15:06 poeti8

@poeti8 I guess as CORS is enabled, I can send POST request to the /api/auth/login endpoint for the login.

Maybe that's enough.

Let me try with an API client for testing.

abhijithvijayan avatar Jun 10 '19 15:06 abhijithvijayan

@poeti8 Why is the login not successful? It works from browser but not from api client?

Also, what is the endpoint to get the generated api key if it exists? I guess it works only on passport session.

abhijithvijayan avatar Jun 10 '19 15:06 abhijithvijayan

@abhijithvijayan send as JSON body.

poeti8 avatar Jun 10 '19 15:06 poeti8

@poeti8 The app will work like this For login sends a POST request to /api/auth/login if success,

  • gets api key (GET to /api/auth/usersetting)
    • if not exist generate one (POST to /api/auth/generateapikey)
  • also gets the url history (GET to /api/url/geturls)

On submission of long urls, it might be better to give the custom url option after once the url is shortened (like edit url option)

The only thing I am missing here is getting api key(or generating it) with the login token obtained after loggin in. Could you make it more clear?

abhijithvijayan avatar Jun 10 '19 16:06 abhijithvijayan

The only thing I am missing here is getting api key(or generating it) with the login token obtained after loggin in.

When login you'll get a token, when got the token now you can call the other endpoints with the API key in the header of request: { headers: { 'X-API-KEY': 'samplekey' } }

poeti8 avatar Jun 15 '19 07:06 poeti8

@poeti8 what if the api key is not generated?

Edit: The token I get after logging in, is to be send in Authorization Header as a Bearer Token, for the subsequent requests, right? or is it in the query parameter?

abhijithvijayan avatar Jun 15 '19 12:06 abhijithvijayan

Edit: The token I get after logging in, is to be send in Authorization Header as a Bearer Token, for the subsequent requests, right? or is it in the query parameter?

This is all in the Kutt readme. Send it as X-API-KEY header.

poeti8 avatar Jun 22 '19 14:06 poeti8

What is the progress of kutt android app? A react native app can be build.

xianx avatar Aug 23 '19 18:08 xianx

@xianx Yeah I was thinking of the same. Currently it is not started yet as I was busy with other projects.

Will start working on it soon. Thanks.

abhijithvijayan avatar Aug 24 '19 15:08 abhijithvijayan

Any news ?

NewRedsquare avatar Nov 10 '20 01:11 NewRedsquare

I havent had a chance to work on it. Sorry.

abhijithvijayan avatar Nov 10 '20 04:11 abhijithvijayan

Just found Kutt which is exactly what I was looking for :)

I've started working on the android app. Feel free to follow progress here: https://github.com/atommarvel/shears-for-kutt

atommarvel avatar May 24 '21 13:05 atommarvel

@atommarvel congrats and thank you a LOT for beginning this work !

I switched to another selfhosted url shortener only due to the lack of android app... i'll probably go back to kutt then

NewRedsquare avatar May 24 '21 15:05 NewRedsquare

@abhijithvijayan / @MKRhere or any Kutt owner!

Question semi-related to this issue!

For the android app icon would yall prefer it to:

  • use the Kutt logo
  • incorporate the Kutt logo
  • not use the Kutt logo at all
  • you don't care

Also, feel free to assign this issue to me if you want :)

atommarvel avatar May 26 '21 04:05 atommarvel

@poeti8 ^^

abhijithvijayan avatar May 26 '21 05:05 abhijithvijayan

You can use the Kutt logo, but have a clear indication that this is not from Kutt developers (or mention "unofficial" somewhere). Repo description, marketplace description and "about app" section (if any) are good places.

MKRhere avatar May 26 '21 06:05 MKRhere