package com.retrytech.strangerapp.utils.sample;


import com.retrytech.strangerapp.utils.media.RtcTokenBuilder;

public class RtcTokenBuilderSample {

    String appId = "4fe3fcee608d40e092d5c7ad0a9bcfc6";
    String appCertificate = "2507c95c98d14ae89b5954873db1ae1d";
    int expirationTimeInSeconds = 3600;

    public String generateToken(String channelName, int uID) {

        RtcTokenBuilder token = new RtcTokenBuilder();
        int timestamp = (int) (System.currentTimeMillis() / 1000 + expirationTimeInSeconds);
        String result;

        result = token.buildTokenWithUid(appId, appCertificate,
                channelName, uID, RtcTokenBuilder.Role.ROLE_PUBLISHER, timestamp);
        return result;
    }
}
