1

我有一系列咨询,其中有医生和患者 ID,还有咨询开始时间和结束时间。

我正在使用 buildTokenWithAccount() 生成一个 agora 令牌,令牌生成成功并存储在 Firebase 中。但问题是当我开始视频通话时它正在工作,我无法与其他参与者联系。我正在使用这个例子:https ://github.com/AgoraIO/Agora-Flutter-SDK/tree/master/example/lib 。

> Note: Channel is successful join but not able to connect video call.

这是我用于生成 agora 令牌的云函数。

    function generateToken(channelName: string, userAccount: string, expirationTime:     FirebaseFirestore.Timestamp): string | null {
        const appId = "my-app-id";
        const appCertificate = "my-certificate-id";
        const role = Agora.RtcRole.isPublisher ? Agora.RtcRole.PUBLISHER : Agora.RtcRole.SUBSCRIBER;
        // const role = Agora.RtcRole.PUBLISHER;
    
        const expirationTimeInSeconds = 3600;
        const currentTimestamp = Math.floor(expirationTime.toDate().getTime() / 1000);
    
        // This token will be Expire After 1 hours of current Time
        const privilegeExpiredTs = currentTimestamp + expirationTimeInSeconds;
    
        try {
            const token = Agora.RtcTokenBuilder.buildTokenWithAccount(appId, appCertificate,  channelName, userAccount, role, privilegeExpiredTs);
            console.log("Got RTC token: " + token);
          return token;
        } catch (error) {
            console.log(privilegeExpiredTs);
            console.log("Error caught while generating token: ß" + error);
            return null;
    
        }
    }

日志:

I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
D/BluetoothHeadset(19872): Binding service...
D/agora-jni(19872): android bridge create done...
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: true, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"


----------
4

0 回答 0