如何提及“@”用户在Instagram的应用程序 [英] How to mention users with "@" in app like Instagram

查看:200
本文介绍了如何提及“@”用户在Instagram的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个具有照片共享的应用程序,我正在尝试添加功能来提及(或标记)用户。 Twitter是最初开始使用@与用户名标记用户,但现在从Facebook到Instagram的一切都在使用它。这是在iOS端还是在后端实现的?我目前正在Django编程后端,但由于某种原因,我认为这将在iOS端完成。关于如何在Django或iOS中提及用户,他们的消息很少。

I am creating an app that has photo sharing, and I am trying to add in the functionality to mention (or tag) users. Twitter is what originally starting using "@" with a username to tag users but now everything from Facebook to Instagram is using it. Is this something that is implemented on the iOS side or in the back end? I am currently programming the back end in Django, but for some reason I think this would be accomplished on the iOS end. There is surprisingly very little information out their on how to mention users in either Django or iOS.

基本上,创建帖子时,我想创建一个用户提及通过键入@,后跟一个用户名(不含空格),这将在帖子中显示他们的名字,如下所示:@username,可以点击,导致该用户的个人资料。如果我不明白我的问题,请让我知道。任何帮助,例如指出我正确的方向从哪里开始这样的东西,将非常感激。谢谢! :)

Basically, when creating a post, I'd like to create a user mention by typing "@" followed by a username (with no spaces between) which would display their name in the post like this: @username which would be clickable, leading back to that user's profile. If I am unclear in any way with my question please let me know. Any help, such as pointing me in the right direction of where to start with something like this, would be much appreciated. Thanks! :)

推荐答案

聆听iOS上的输入。当用户键入 @ ,后跟一个字符时,调用您的服务器上的一个URL( / user / lookup /?username = joe ,例如)路由到以 joe 开头的用户查找的视图。将其作为json返回并显示在下拉列表中。

Listen to the input on iOS. When the user types an @, followed by a character, make a call to an url on your server (/user/lookup/?username=joe for example) that routes to a view which looks up up users beginning with joe. Return it as json and display it in a dropdown.

资料来源:如何提及带有@的用户在Instagram中的应用程序

这篇关于如何提及“@”用户在Instagram的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆