简体   繁体   English

从iOS生成动态OpenTok会话ID

[英]Generating Dynamically OpenTok Session ID from iOS

I am using OpenTokSDK for iPhone (using it Natively) I have made the code for calling but just there is one problem.:- I have to statically Add the SessionID. 我正在使用OpenTokSDK for iPhone(使用它本地)我已经制作了调用代码,但只有一个问题.-我必须静态添加SessionID。 But i want to generate the ID Dynamically. 但我想动态生成ID。

How can I do this ? 我怎样才能做到这一点 ? Please help! 请帮忙!

Thanks In Advance 提前致谢

Full disclosure: I am a developer for TokBox. 完全披露:我是TokBox的开发人员。

The only safe way to get session ID and token credentials to the device is by developing an application server that suits the specific needs of your app. 获取会话ID和令牌凭证到设备的唯一安全方法是开发适合您应用程序特定需求的应用程序服务器。 We have a number of server-side SDKs available on GitHub ( link ) that will interface with the OpenTok server API to generate this data. 我们在GitHub( 链接 )上提供了许多服务器端SDK,它们将与OpenTok服务器API连接以生成此数据。

Note well the server-side SDK is enough to get your credentials generated, but not all devices will be on the same session, so things like user management and application workflows are all considerations that cannot be easily written to an open source library. 请注意,服务器端SDK足以获取您的凭据,但并非所有设备都在同一会话中,因此用户管理和应用程序工作流等内容都是无法轻松写入开源库的注意事项。

That said, we did try to make some of these examples more clear by writing code examples on our blog ( link ). 也就是说,通过在我们的博客上编写代码示例( 链接 ),我们确实尝试使这些示例更加清晰。 You can relieve much of the overhead of writing your own application server (no doubt a daunting task, especially the first time around) by leveraging one of the third party signaling services available, like Parse and Pusher , to name two. 通过利用ParsePusher之类的第三方信令服务之一,您可以减轻编写自己的应用服务器(无疑是一项艰巨的任务,特别是第一次)的大量开销。

Wobbals is correct, and In addition to what Wabbals has mentioned, generating sessions/tokens is very simple, the sample code required for each server language (PHP, NodeJS, C#, Ruby) is located in OpenTok's Github page . Wobbals是正确的,除了Wabbals提到的,生成会话/令牌非常简单,每种服务器语言(PHP,NodeJS,C#,Ruby)所需的示例代码位于OpenTok的Github页面中

Furthermore, if you choose not to have server side code and use Parse to handle your back-end, there is a wonderful writeup about how to use Parse's cloud code module for OpenTok to generate sessions and tokens. 此外,如果您选择不具有服务器端代码,并使用解析来处理你的后端,有一个精彩的书面记录有关如何使用解析的云代码模块OpenTok生成会话和令牌。

Good Luck! 祝好运!

I strongly felt that the tokbox tutorial was quite basic but had steeper learning curve. 我强烈认为tokbox教程非常基础,但学习曲线更陡峭。 So I ended up wrote out my own app-cum-tutorial. 所以我最终写出了我自己的应用程序兼教程。

Though late, I felt compelled to post here: How To write your first iPhone Video Chat App using parse and opentok(tokbox) 虽然很晚,我觉得有必要在这里发帖: 如何使用parse和opentok(tokbox)编写你的第一个iPhone视频聊天应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM