2017-07-03 79 views
0

我有一個錯誤,當採取多個部分,因爲它我使用ListView的Android代碼是存儲部分,已經存儲,與每一行有很多,使視頻會議sessionErrorDomain:令牌無效。在api OpenTok Android SDK

錯誤消息:sessionErrorDomain:無效令牌。

確保您使用的是最新的 OpenTok服務器SDK(http://tokbox.com/opentok/libraries/server 令牌:

T1 == cGFydG5lcl9pZD00NTkwNjk2MiZzaWc9NDU4YTZkNDVjNDcwMWUyY2M5OTFiNTI4NDliY2EzMGQzMjQxZjVkMDpzZXNzaW9uX2lkPTJfTVg0ME5Ua3dOamsyTW41LU1UUTVPVEE1T1RRNE9UWTNOMzVXTTJ3d1VERXZRVFZHY0ZVclkxWXdkMWh1Tm0xVGVuQi1VSDQmY3JlYXRlX3RpbWU9MTQ5OTA5OTUxMSZub25jZT0wLjM5NDM2Nzc5MTY2NDQ0OTI0JnJvbGU9cHVibGlzaGVyJmV4cGlyZV90aW1lPTE0OTkxMDMxMDg =

的代碼的其餘部分是在

謝謝合作

package com.proyecto.opentoolbox; 


import android.webkit.URLUtil; 

public class OpenTokConfig { 
    // *** Fill the following variables using your own Project info from the OpenTok dashboard *** 
    // ***      https://dashboard.tokbox.com/projects       *** 


    public static final String API_KEY = "45906962"; 
    public static final String SESSION_ID = "1_MX40NTkwNjk2Mn5-MTQ5OTEwNTY3ODM2NX5oaUNxOXFDMU1BTTlqL0VmRDFEZXFCcHR-fg"; 
    public static final String TOKEN = "T1==cGFydG5lcl9pZD00NTkwNjk2MiZzaWc9ZjgzYTVhN2IzMmY4OWEzMTgxNGJlYzI3N2JlYWRmODc0MGE3NzFhNDpzZXNzaW9uX2lkPTFfTVg0ME5Ua3dOamsyTW41LU1UUTVPVEV3TlRZM09ETTJOWDVvYVVOeE9YRkRNVTFCVFRscUwwVm1SREZFWlhGQ2NIUi1mZyZjcmVhdGVfdGltZT0xNDk5MTA1NzA4Jm5vbmNlPTAuOTEzNDgxMTA0OTk1NjIzMyZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNTAxNjk3NzA2"; 
    public static String API_KEYOtra; 
    public static String Api_Key_Radio; 
    public static final String Session_Id_Otra = "2_MX40NTkwNjk1Mn5-MTQ5OTEwNTMwODExNn4yUjNtZEVUZ0FrU1RLSXRMZW5OaEIyQ0t-fg"; 
    public static final String Token_Otra="T1==cGFydG5lcl9pZD00NTkwNjk1MiZzaWc9NDYzMjJiMzUyYjkwZmFjOGQxZjMxMWZmYzk1MjE3YzJlNGQ5NmFhNTpzZXNzaW9uX2lkPTJfTVg0ME5Ua3dOamsxTW41LU1UUTVPVEV3TlRNd09ERXhObjR5VWpOdFpFVlVaMEZyVTFSTFNYUk1aVzVPYUVJeVEwdC1mZyZjcmVhdGVfdGltZT0xNDk5MTA1NDA3Jm5vbmNlPTAuNjgwODk4NDc0NTMzMzQ2JnJvbGU9cHVibGlzaGVyJmV4cGlyZV90aW1lPTE1MDE2OTczOTc="; 
    public static final String Session_Id_OtraRacio = "2_MX40NTg5NjA2Mn5-MTQ5ODk2NDIxNDkwNX40WWhrcGFEdzJDYjZVRlpUQSsvd2VtdFF-UH4"; 
    public static final String Token_OtraRadio = "T1==cGFydG5lcl9pZD00NTg5NjA2MiZzaWc9ZjhkNDlhMWYwM2ZlNjk5YzhjNzE3ZDRkYTgwYWU1NmQ5YTk4OWEyYzpzZXNzaW9uX2lkPTJfTVg0ME5UZzVOakEyTW41LU1UUTVPRGsyTkRJeE5Ea3dOWDQwV1docmNHRkVkekpEWWpaVlJscFVRU3N2ZDJWdGRGRi1VSDQmY3JlYXRlX3RpbWU9MTQ5ODk2NDI0MCZub25jZT0wLjAxODYyODQwNzM4NDUyMzUzOCZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNDk4OTY3ODM4JmNvbm5lY3Rpb25fZGF0YT1wcnVlYmElMjByYWRpbw=="; 

    public OpenTokConfig(){} 
    public String getApi_Key() { 
     return Api_Key; 
    } 

    public void setApi_Key(String api_Key) { 
     Api_Key = api_Key; 
     API_KEYOtra = api_Key; 
    } 

    public String getSession_Id() { 
     return Session_Id; 
    } 

    public void setSession_Id(String session_Id) { 

     Session_Id = session_Id; 
     //Session_Id_Otra=session_Id; 
    } 

    public String getToken() { 
     return Token; 
    } 

    public void setToken(String token) { 

     Token = token; 
     //Token_Otra=token; 
    } 


    /*       ***** OPTIONAL ***** 
    If you have set up a server to provide session information replace the null value 
    in CHAT_SERVER_URL with it. 

    For example: "https://yoursubdomain.com" 
    */ 
    public static final String CHAT_SERVER_URL = null; 
    public static final String SESSION_INFO_ENDPOINT = CHAT_SERVER_URL + "/session"; 


    // *** The code below is to validate this configuration file. You do not need to modify it *** 

    public static String webServerConfigErrorMessage; 
    public static String hardCodedConfigErrorMessage; 

    public static boolean areHardCodedConfigsValid() { 
     if (OpenTokConfig.API_KEY != null && !OpenTokConfig.API_KEY.isEmpty() 
       && OpenTokConfig.SESSION_ID != null && !OpenTokConfig.SESSION_ID.isEmpty() 
       && OpenTokConfig.TOKEN != null && !OpenTokConfig.TOKEN.isEmpty()) { 
      return true; 
     } 
     else { 
      hardCodedConfigErrorMessage = "API KEY, SESSION ID and TOKEN in OpenTokConfig.java cannot be null or empty."; 
      return false; 
     } 
    } 

    public static boolean isWebServerConfigUrlValid(){ 
     if (OpenTokConfig.CHAT_SERVER_URL == null || OpenTokConfig.CHAT_SERVER_URL.isEmpty()) { 
      webServerConfigErrorMessage = "CHAT_SERVER_URL in OpenTokConfig.java must not be null or empty"; 
      return false; 
     } else if (!(URLUtil.isHttpsUrl(OpenTokConfig.CHAT_SERVER_URL) || URLUtil.isHttpUrl(OpenTokConfig.CHAT_SERVER_URL))) { 
      webServerConfigErrorMessage = "CHAT_SERVER_URL in OpenTokConfig.java must be specified as either http or https"; 
      return false; 
     } else if (!URLUtil.isValidUrl(OpenTokConfig.CHAT_SERVER_URL)) { 
      webServerConfigErrorMessage = "CHAT_SERVER_URL in OpenTokConfig.java is not a valid URL"; 
      return false; 
     } else { 
      return true; 
     } 
    } 

    public String getApi_Key_Radio() { 
     return Api_Key_Radio; 
    } 

    public void setApi_Key_Radio(String api_Key_Radio) { 
     Api_Key_Radio = api_Key_Radio; 
    } 
} 

回答

0

Opentok會話有一個使用期限。確保您沒有使用仍處於活動狀態的令牌。如果您使用opentok的門戶創建令牌,則可以在頁面上設置有效期,或者如果您使用的是API,則也可以指定有效期。