RemoteMonster provides resources shared by users during broadcasting and communication under the name channel. This channel is created the first time you create it, provides each unique Id, and gets or retrieves a list of them to connect to a specific channel. In addition, you can assign a name to your channel in order to make it easier to use.
Please refer to the following for the overall flow and corresponding Callbacks.
Livecast
Here is how to get a list of broadcasts on the air. It is commonly used in UIs to find broadcasts to enter from the list.
remonCast.fetchCasts { (err, results) iniflet err = err {// If there is an error during the search, remonCast.onError () will not be called.print(err.localizedDescription) } elseiflet results = results {for cast:RemonSearchResult in results {// Do Somethig } }}remonCast.join(myChannelId)
RemonCast *remonCast = [[RemonCast alloc]init];
[remonCast fetchCastsWithIsTest:YES complete:^(NSArray<RemonSearchResult *> * _Nullable chs) {
if (chs != nil) {
for (RemonSearchResult *item in chs) {
// Do Somethig
}
}
}];
Communication
Here's how to get a list of calls from your communications. It is used in situations such as a random chat and is not generally used.
let remonCall =RemonCall()remonCall.fetchCalls { (err, results) iniflet err = err {// If there is an error during the search, remonCall.onError() will not be called.print(err.localizedDescription) } elseiflet results = results {for call:RemonSearchResult in results {if itme.status =="WAIT" { // Only WAIT channels// Do Somethig } } }}remonCall.connect(myChannelId)
RemonCall *remonCall = [[RemonCall alloc]init];
[remonCall fetchCastsWithIsTest:YES complete:^(NSArray<RemonSearchResult *> * _Nullable chs) {
if (chs != nil) {
for (RemonSearchResult *item in chs) {
if ([item.status isEqualToString@"WAIT"]) {
// Do Somethig
}
}
}
}];