This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:agora_token_example/screens/call_page.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:permission_handler/permission_handler.dart'; | |
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class UserDetails extends StatefulWidget { | |
final String userName; | |
UserDetails(this.userName); | |
@override | |
_UserDetailsState createState() => _UserDetailsState(); | |
} | |
class _UserDetailsState extends State<UserDetails> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:math'; | |
import 'package:agora_token_example/utils/config.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:agora_rtc_engine/rtc_engine.dart'; | |
import 'package:agora_rtc_engine/rtc_local_view.dart' as RtcLocalView; | |
import 'package:agora_rtc_engine/rtc_remote_view.dart' as RtcRemoteView; | |
import 'package:http/http.dart' as http; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:agora_rtc_engine/agora_rtc_engine.dart'; | |
import 'package:flutter/material.dart'; | |
class StatusBar extends StatefulWidget { | |
@override | |
_StatusBarState createState() => _StatusBarState(); | |
} | |
class _StatusBarState extends State<StatusBar> { | |
bool micStatus = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@POST | |
@Path("rtm") | |
@Produces(MediaType.APPLICATION_JSON) | |
public Object getRTMToken(AgoraRTMRepository resource) throws Exception { | |
String userId = resource.getUserId(); | |
if (userId==null){ | |
JSONObject error=new JSONObject(); | |
error.put("error","User ID cannot be blank"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agoratoken; | |
import com.sandeep.agoratoken.media.RtcTokenBuilder; | |
import com.sandeep.agoratoken.rtm.RtmTokenBuilder; | |
import com.sandeep.agoratoken.rtm.RtmTokenBuilder.Role; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agoratoken; | |
public class AgoraRTMRepository { | |
private static String appId = "APP_ID"; | |
private static String appCertificate = "APP_CERT"; | |
private String userId = "USER_ID"; | |
private int expireTimestamp = 0; | |
public static String getAppId() { | |
return appId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agoratoken; | |
public class AgoraRepository { | |
static String appId = "APP_ID"; //replace app id | |
static String appCertificate = "APP_CERT"; //replace app cert | |
private String channelName; | |
private int uid = 0; | |
private int expirationTimeInSeconds = 3600; | |
private int role = 2; // By default subscriber |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agoratoken; | |
public class AgoraRTMRepository { | |
private static String appId = "APP_ID"; | |
private static String appCertificate = "APP_CERT"; | |
private String userId; | |
private int expireTimestamp = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agoratoken; | |
import com.sandeep.agoratoken.media.RtcTokenBuilder; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import org.json.simple.JSONObject; |