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

joining with expired token, there is not any event which show token expired. #2061

Open
2 of 5 tasks
bittuRichestsoft opened this issue Oct 28, 2024 · 0 comments
Open
2 of 5 tasks

Comments

@bittuRichestsoft
Copy link

Version of the agora_rtc_engine

6.3.1

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

I am trying to join a video call with agora RTC engine with expired token. But there is not any event which providing any information regarding the token expired. onTokenPrivilegeWillExpire giving response before 30 seconds but it calling when token valid and call is continue. But i need information if i am trying to join call with expired token. So i expect there should be any event/function which will provide the information regarding token validity, its expired or alive yet.

Expected results

i expect there should be any event/function which will provide the information regarding token validity, its expired or alive yet.

Actual results

there is not any event which providing any information regarding the token expired

Code sample

Code sample
[Paste your code here]
```  rtcEngine?.registerEventHandler(
      RtcEngineEventHandler(
        onJoinChannelSuccess: (RtcConnection connection, int elapsed) async {
          print(
              "agoraEvent onJoinChannelSuccess local user ${connection.localUid} joined");

          localUserJoined = true;
          localJoinedUserId = connection.localUid!;

          print("localJoinedUserId is =$localJoinedUserId");

          notifyListeners();
        },
        onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
          debugPrint(
              "agoraEvent connection onUserJoined remote user $remoteUid joined");
          /*if (previewingUserIndx == 0) {
              previewingUserIndx = remoteUid;
          }*/
          // remoteUids = remoteUid;
          remoteUserLst.add(RemoteUser(remoteUid: remoteUid,isAudio: true,isVideo: true));
          notifyListeners();
        },
        onUserOffline: (RtcConnection connection, int remoteUid,
            UserOfflineReasonType reason) {
          debugPrint(
              "agoraEvent onUserOffline remote user $remoteUid left channel");

        for(int checkUsr =0; checkUsr < remoteUserLst.length; checkUsr++ )
{
if(remoteUid==remoteUserLst[checkUsr].id) {
  debugPrint( "id matched ${remoteUid}==${remoteUserLst[checkUsr].id}");
  remoteUserLst.removeAt(checkUsr);
}
// return ;
}
        notifyListeners();

          debugPrint(  "remain remoteUids ${remoteUserLst.length}");


        },
        onUserMuteAudio: (connection, remoteUid, muted) {
          debugPrint("agoraEvent onUserMuteAudio user $remoteUid muted=$muted");


          for(int i = 0; i< remoteUserLst.length; i++){

            if(remoteUserLst[i].id==remoteUid)
            {
              remoteUserLst[i].isAudiEnabled=!muted;
              notifyListeners();
              debugPrint("changedAudio of user $remoteUid is=${remoteUserLst[i].isAudiEnabled}");

            }
          }


        },


        onUserMuteVideo: (connection, remoteUid, muted) {
          debugPrint("agoraEvent onUserMuteVideo user $remoteUid muted=$muted");

          for(int i = 0; i< remoteUserLst.length; i++){

 if(remoteUserLst[i].id==remoteUid)
   {
     remoteUserLst[i].isVideoEnabled=!muted;
     notifyListeners();
     debugPrint("changedVideo of user $remoteUid is=${remoteUserLst[i].isVideoEnabled}");

   }
          }

        },
        onUserEnableVideo: (connection, remoteUid, muted) {
          debugPrint(
              "agoraEvent onUserEnableVideo user $remoteUid muted=$muted");

     /*     for(int i = 0; i< remoteUids.length; i++){

            if(remoteUids[i].id==remoteUid)
            {
              remoteUids[i].isVideoEnabled=true;
            }
          }

          notifyListeners();*/




        },
        onTokenPrivilegeWillExpire: (RtcConnection connection, String token) {
          debugPrint(
              'agoraEvent [onTokenPrivilegeWillExpire] connection: ${connection.toJson()}, token: $token');
        },
        onLeaveChannel: (connection, stats) {

      //    remoteUids = null;

          notifyListeners();
        },
        onNetworkQuality: (connection, remoteUid, txQuality, rxQuality) {
          // debugPrint("agoraEvent onNetworkQuality");
        },

onStreamMessageError: ( RtcConnection connection, int remoteUid, int streamId,
    ErrorCodeType code, int missed, int cached) {
  debugPrint ("onStreamMessageError connection=$connection remoteUid=$remoteUid streamId=$streamId code=$code missed=$missed cached=$cached");
},

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>
![Screenshot 2024-10-28 at 9 26 25PM](https://github.com/user-attachments/assets/dc16f56b-abd4-48f2-8f90-5c04ef79715c)


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]
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

1 participant