从Facebook应用程序打开外部weblink并传递facebook用户名

时间:2016-01-14 18:53:48

标签: ios facebook

我正在构建一个IOS应用程序,它将使用社交媒体框架(不是facebook-graph-api)将网站链接发布到Facebook和其他社交媒体上,它可以按照我的意愿运行。例如:

http://example.com/page1.html?code=123456

但我确实希望当我的朋友在facebook上打开外部链接并在外部浏览器中打开时 - 他们的Facebook用户名会被传递到浏览器,所以我可以允许他们在网页链接中添加评论。

澄清 - 要添加的评论将在我的网站上为他们刚刚打开的页面(而不是Facebook中的评论)

是否可以这样做?

1 个答案:

答案 0 :(得分:1)

发布时,您只能对URL执行某些操作。好吧,如果我们在name of friend的墙上发布网址,那么我们可以通过以下方法解决您的问题。

我认为您可以在网址中附加get parameter作为http://facebook.com/?Name=Friend_Name&SecurityCode=Some_Unique_Code_Based_On_Friends_Name 。因此,只要您的朋友打开此链接,其相应的名称也会与URL一起传递。就安全性而言,您可以考虑将一些安全代码附加到URL。哪个将根据朋友的姓名进行验证 例如。

program testrand

integer, parameter :: nz = 160, nf = 160, nlt = 90

real :: tmpidx(3)
integer :: idxarr(3), idx1, idx2, idx3, seed_size, ticks
integer, allocatable :: seed(:)

call random_seed(size=seed_size)
allocate(seed(seed_size))

call system_clock(count=ticks)
seed = ticks+37*(/(i-1, i=1,seed_size)/)
call random_seed(put=seed)

deallocate(seed)

call random_number(tmpidx)
idxarr = tmpidx * (/nz, nf, nlt/)
idx1 = max(1,idxarr(1))
idx2 = max(1,idxarr(2))
idx3 = max(1,idxarr(3))
print *,idx1, idx2, idx3

end program
相关问题