Class: Agora::AgoraDynamicKey2::RtmTokenBuilder
- Inherits:
-
Object
- Object
- Agora::AgoraDynamicKey2::RtmTokenBuilder
- Defined in:
- lib/agora/dynamic_key2/rtm_token_builder.rb
Class Method Summary collapse
-
.build_token(app_id, app_certificate, user_id, expire) ⇒ Object
Build the RTM token.
Class Method Details
.build_token(app_id, app_certificate, user_id, expire) ⇒ Object
Build the RTM token.
13 14 15 16 17 18 19 20 |
# File 'lib/agora/dynamic_key2/rtm_token_builder.rb', line 13 def self.build_token(app_id, app_certificate, user_id, expire) access_token = Agora::AgoraDynamicKey2::AccessToken.new(app_id, app_certificate, expire) service_rtm = Agora::AgoraDynamicKey2::ServiceRtm.new(user_id) service_rtm.add_privilege(Agora::AgoraDynamicKey2::ServiceRtm::PRIVILEGE_JOIN_LOGIN, expire) access_token.add_service(service_rtm) access_token.build end |