You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm trying out the SDK but am unable to run any of the samples.
I created an Application with "Video" enabled
I went into the Video API Playground, selected the account, app and relayed mode
Injected the generated values into the fields for some of the samples (Basic, CallKit, Video-Transformers)
Result from the Console:
***** OpenTok iOS SDK | Version/Revision: ios-2.27.2/45959e736f520b422b614d9b93764af56554def9 | Library built on: Mar 15 2024 | CA bundle version: Mon Mar 11 15:25:27 2024 GMT | Copyright 2024 Vonage | https://www.vonage.com/legal/communications-apis/terms-of-use/
2024-04-11 12:03:29.303800-0300 Video-Transformers[11709:6967822] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 91 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 91 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
[ERROR] otk_anvil.cpp:452 - otk_anvil_on_session_info failed. nCode=1
[ERROR] rumor_client_v1.c:274 - otk_rumor_v1_client_send (pClient == NULL) rumor client is not initialized and cannot send message
session Failed to connect: Invalid token format
Additionally, I also tried creating sessions and tokens through the server API using python and ruby:
from opentok import Client, MediaModes
import time
api_key = "<api_key>" // Found in Settings, Master
api_secret = "<api_secret>" // Found in Settings, below the api_key
client = Client(api_key, api_secret)
session = client.create_session(media_mode=MediaModes.relayed)
print("session_id:")
print(session.session_id)
print("token:")
print(session.generate_token(expire_time=int(time.time()) + 10000))
Output:
Traceback (most recent call last):
File "/Users/nobre/Downloads/vonage_token/lib/python3.12/site-packages/opentok/opentok.py", line 483, in create_session
raise AuthError("Failed to create session, invalid credentials")
opentok.exceptions.AuthError: Failed to create session, invalid credentials
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nobre/Downloads/vonage_token/generator.py", line 9, in <module>
session = client.create_session(media_mode=MediaModes.relayed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nobre/Downloads/vonage_token/lib/python3.12/site-packages/opentok/opentok.py", line 488, in create_session
raise RequestError("Failed to create session: %s" % str(e))
opentok.exceptions.RequestError: Failed to create session: Failed to create session, invalid credentials
/Users/nobre/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/opentok-4.8.1/lib/opentok/client.rb:62:in `rescue in create_session': Failed to connect to OpenTok. Response code: Authentication failed while creating a session. API Key: <redacted> (OpenTok::OpenTokError)
from /Users/nobre/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/opentok-4.8.1/lib/opentok/client.rb:47:in `create_session'
from /Users/nobre/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/opentok-4.8.1/lib/opentok/opentok.rb:204:in `create_session'
from generator.rb:8:in `<main>'
/Users/nobre/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/opentok-4.8.1/lib/opentok/client.rb:57:in `create_session': Authentication failed while creating a session. API Key: 12f24f75 (OpenTok::OpenTokAuthenticationError)
from /Users/nobre/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/opentok-4.8.1/lib/opentok/opentok.rb:204:in `create_session'
from generator.rb:8:in `<main>'
What am I doing wrong? Thank you.
The text was updated successfully, but these errors were encountered:
I've since realized with the hint from the Session inspector tool that the samples actually expect the ApplicationID when they mention API Key. That is very confusing! However, the backend session generation still doesn't work in any way I try it.
Hi! I'm trying out the SDK but am unable to run any of the samples.
Result from the Console:
Additionally, I also tried creating sessions and tokens through the server API using python and ruby:
Output:
Ruby attempt:
Output:
What am I doing wrong? Thank you.
The text was updated successfully, but these errors were encountered: