2

I have a collection of consultations where I have a doctor and patient IDs as well I have a consultation start time and end time.

I am generating an agora token with buildTokenWithAccount(), token is generated Successful and stored in Firebase. But problem is that it's working when I am starting a video call, I am unable to connect with another participant. I am using this example: https://github.com/AgoraIO/Agora-Flutter-SDK/tree/master/example/lib.

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

This is my cloud Function for generating an agora token.

    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;
    
        }
    }

Logs:

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"


----------
  • The logs that you shared are just network logs and doesn't relate to the issue you are facing. If I understand your issue correctly the local user is able to join the channel and the remote user is not able to join the same call. If that is the case can you please check that you're using the same App Id, token and channel name for both the users. You can also go through this blog which explains how to use tokens with your Agora Flutter Application: https://www.agora.io/en/blog/connecting-to-agora-with-tokens-flutter/ – meherdeep thakur May 06 '21 at 10:00
  • Thank you for your time, but user join channel successful but not connect on video call, while if i generate token manually on agora console it's working, – Zeeshan Saleem May 08 '21 at 19:32
  • While generating a token you will be getting a uid as well. Make sure you pass that you pass that did value to token as well. – meherdeep thakur May 08 '21 at 21:17
  • I am generating token using user account instead of uid – Zeeshan Saleem May 10 '21 at 06:52
  • You can use `getUserInfoByUserAccount` to get the corresponding uid. You can read more about it over here: https://docs.agora.io/en/Voice/API%20Reference/flutter/rtc_engine/RtcEngine/getUserInfoByUserAccount.html – meherdeep thakur May 10 '21 at 15:36

0 Answers0