Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create engine failed, error code: -7 , with Fetching the Token scene #90

Closed
Nelsonlala opened this issue Jun 30, 2022 · 3 comments
Closed

Comments

@Nelsonlala
Copy link

hi, i am trying to use the dynamic fetch token from the server feature in the scene from joinChannelVideoToken file,

following website: https://www.agora.io/en/blog/connecting-to-agora-with-tokens-using-unity/

I set up the token server in Heroku (following : https://github.com/AgoraIO-Community/agora-token-service)

then i replace the token base with the updated server url. and set up app id.

then when i run the scene in the unity editor, the error is shown below. anyone can help me with this

Create engine failed, error code: -7
UnityEngine.Debug:LogError (object)
agora_gaming_rtc.IRtcEngine:.ctor (string) (at Assets/AgoraEngine/Scripts/AgoraGamingSDK/AgoraGamingRtcEngine.cs:241)
agora_gaming_rtc.IRtcEngine:GetEngine (string) (at Assets/AgoraEngine/Scripts/AgoraGamingSDK/AgoraGamingRtcEngine.cs:5021)
HelloVideoTokenAgora:InitEngine () (at Assets/API-Example/examples/advanced/JoinChannelVideoToken/HelloVideoTokenAgora.cs:77)
HelloVideoTokenAgora:Start () (at Assets/API-Example/examples/advanced/JoinChannelVideoToken/HelloVideoTokenAgora.cs:34)

@plutoless
Copy link
Contributor

-7 means the sdk has not been initialized properly. could you pls show us your minimal reproducible project or relevant source code?

@Nelsonlala
Copy link
Author

hi, I redownload the SDK and it seems fine now.

But I am following the website: https://www.agora.io/en/blog/connecting-to-agora-with-tokens-using-unity/

to use the dynamic fetch token. however, I would like to use this feature in the WebGL platform.following this sdk: https://github.com/AgoraIO-Community/Agora_Unity_WebGL

and i try the dynamic token example scene there and it's not working (token client that one ). then i try to implement the script in this sdk to the WebGL sdk but now it's become so messy.

and facing two errors:

  1. Assets\API-Example\tokenchannel\TokenChannel.cs(67,13): error CS7036: There is no argument given that corresponds to the required formal parameter 'newToken' of 'TokenChannel.FetchToken(string)'

  2. Assets\API-Example\tokenchannel\TokenChannel.cs(126,20): error CS7036: There is no argument given that corresponds to the required formal parameter 'options' of 'IRtcEngine.JoinChannel(string, string, string, uint, ChannelMediaOptions)'

ANY suggestion to solve the problem!!

@Nelsonlala Nelsonlala reopened this Jul 4, 2022
@icywind
Copy link
Collaborator

icywind commented Oct 4, 2022

@Nelsonlala I didn't notice your issue until today. Hope this can still help. For any WebGL issue you should go to the WebGL repo to post there. We have built an example on how to use token in its included API-Examples. Please take a look.

@icywind icywind closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants