GithubHelp home page GithubHelp logo

temasys / skylinksdk-ios-sample Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 9.0 113.89 MB

Temasys SkylinkSDK for iOS - Sample App - Objective C

Home Page: https://temasys.io

License: Other

Ruby 0.10% Objective-C 99.90%
skylink temasys webrtc ios video audio native mobile

skylinksdk-ios-sample's Introduction

SkylinkSDK iOS SampleApp Objective C

The Sample Application(SA), which uses the latest version of the Skylink SDK for iOS, demonstrates its use to provide embedded real time communication in the easiest way. Excluding 'Settings', this App has 6 distinct view controllers, each of them demonstrating how to build the following features:

  • One to one video call with Screen Share
  • Multi party video call
  • Multi party audio call
  • Chatroom and custom messages
  • File transfer
  • Data transfer

Code introduction

The code should be self explanatory. Each view controller works by itself and there is minimal UI code due to to Storyboard usage. In each view controller, the main idea is to configure and instantiate a connection to a room with the Skylink iOS SDK. You will then be able to communicate with another peer joining the same room.

Sample Code with Video and Audio
// Creating configuration
SKYLINKConnectionConfig *config = [SKYLINKConnectionConfig new];
[config setAudioVideoReceiveConfig:AudioVideoConfig_AUDIO_AND_VIDEO];
[config setAudioVideoSendConfig:AudioVideoConfig_AUDIO_AND_VIDEO];

// Creating SKYLINKConnection
SKYLINKConnection *skylinkConnection = [[SKYLINKConnection alloc] initWithConfig:config callback:nil];
self.skylinkConnection.lifeCycleDelegate = self;
self.skylinkConnection.mediaDelegate = self;
self.skylinkConnection.remotePeerDelegate = self;
self.skylinkConnection = skylinkConnection;

// Coonnecting to room
[skylinkConnection connectToRoomWithAppKey:self.skylinkApiKey secret:self.skylinkApiSecret roomName:ROOM_NAME userData:nil callback:nil];

You can then control what happens in the room by sending messages to the SKYLINKConnection instance (like triggering a file transfer request for example), and respond to events by implementing the delegate methods from the 6 protocols. Always set at least the lifeCycleDelegate. For a list of all protocols, see here

Aditionally, in each view controller example's viewDidLoad/initWithCoder method, some properties are initialized. A disconnect button is set in the navigation bar (left corner) as well as its selector implementation (called disconnect). An info button is set on the right corner, as well as its implementation (called showInfos). Those 2 navigation bar buttons selectors are the same in every View Controller example.

The rest of the example view controllers gives you 6 example usages of the Temasys iOS SDK.

How to run the sample project

Step-by-step guide

Prerequisites

Please use Xcode 11

STEP 1

It is recommended to install the SkylinkSDK for iOS via cocoapods. If you do not have it installed, follow the below steps:

Installing Cocoapods

Check that you have Xcode command line tools installed (Xcode > Preferences > Locations > Command line tools(?). If not, open the terminal and run xcode-select --install. Install cocoa pods in the terminal: $ sudo gem install cocoapods

STEP 2

Clone the repo or download the project.

STEP 3

Navigate to the Sample App and Run pod install

STEP 4

Open the .xcworkspace file

STEP 5

Follow the instructions here to create an App and a key on the Temasys Console.

STEP 6

Set your App Key and secret in Constant.h. You may also alter the room names here.

NSString *APP_KEY = @"ENTER APP KEY HERE";
NSString *APP_SECRET = @"ENTER SECRET HERE";

NSString *ROOM_ONE_TO_ONE_VIDEO = @"ROOM_ONE_TO_ONE_VIDEO";
NSString *ROOM_MULTI_VIDEO = @"ROOM_MULTI_VIDEO";
NSString *ROOM_AUDIO = @"ROOM_AUDIO";
NSString *ROOM_MESSAGES = @"MESSAGES-ROOM";
NSString *ROOM_FILE_TRANSFER = @"ROOM_FILE_TRANSFER";
NSString *ROOM_DATA_TRANSFER = @"ROOM_DATA_TRANSFER";
STEP 7

Build and Run. You're good to go!

Please Note

The XCode Simulator does not support video calls.
If you have connected a phone, ensure it is unlocked and the appropriate team is selected under Signing & Capabilities.

Resources

SDK documentation

For more information on the usage of the SkylinkSDK for iOS, please refer to SkylinkSDK for iOS Readme

Subscribe

Star this repo to be notified of new release tags. You can also view release notes on our support portal

Feedback

Please do not hesitate to reach get in touch with us if you encounter any issue or if you have any feedback or suggestions on how we can improve the Skylink SDK for iOS or Sample Applications. You can raise tickets on our support portal.

Copyright and License

Copyright 2019 Temasys Communications Pte Ltd Licensed under APACHE 2.0

Tutorials and FAQs

Getting started with Temasys iOS SDK for iOS
Handle the video view stretching
FAQs

Also checkout our Skylink SDKs for Web and Android

This document was edited for Temasys iOS SDK version 2.0.0

skylinksdk-ios-sample's People

Contributors

janiduw avatar janiduw321 avatar ncurrier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skylinksdk-ios-sample's Issues

Sample App Crashes on iOS 10

When launching the sample app under iOS 10 it crashes with the following message given on the console:

This app has crashed because it attempted to access privacy-sensitive data 
without a usage description.  The app's Info.plist must contain an
 NSCameraUsageDescription key with a string value explaining to the user 
how the app uses this data.

ld: library not found for -lObjC

I tried on one of my mac mini but got this error. And then I tried on other systems the application ran fine. Can you please tell me what could be reason. I tried to search the library because of which the error is displayed. So let me know.

How to implement the one to one video call into my iOS application

Recently i installed the skylink sample application into my Iphone xr and ipad. i tried to connect the video call from one mobile to another mobile but i would not connect to the another device. So please explain briefly how can i work with the video call(One to another)with your application.

Rotation lock

Is there any way to lock rotation created by the camera?
I try to lock the app rotation but for camera itself doesnt work
Thanks.

Runs in Simulator, not on Device

Hi there,

When I run on simulator, this seems to work fine. But when I change to run on my device, it has all kinds of compiler errors, seemingly unable to find UIKit. I am using the latest version of Xcode, 8.1.

Is this something you can reproduce? I have no idea what the issue is, or how to fix it.

Thanks, Sean

Unsupported URL with Sample app

Hello,
While I run sample app with my App ID an secret key, I have Connection failed with "While connecting to the room server: error.code -> -1002, error.description -> Unsupported URL"
Can anyone help me in this position?
Thanks

1-1 Video Call doesn't work, but Multi-Party Does

What reason could there be that the 1-1 Video Call does not get peer video, but with the same credentials the Multi-Party VC shows video?

I cannot see any difference in the setup of the view controller.

To clarify: I am on iOS 10 and I have specified the correct api key and secret. I changed the room name to another one. I did the same in both VideoCallViewController as well as MuliVideoCallViewController. If I go into the former, then I only see my own video. If I go into the latter, I see peer video.

Is that a bug in the sample app? Or what are you doing differently in the multi video call controller so that the remote video works?

Working with Firebase

I developing chat app, i want to confirm that will this will work with firebase? because my app backend is in firebase and i want video and audio call in the app.

Is it still work version???

Hi everybody, i try run this example, did everything that you wrote in README, but it doesn't run, it give error "Invalid argument" and lot of error. Can you check?
2017-05-31 11 57 48

Incorrect URL generated by connectToRoomWithCredentials

Despite giving this function the correct credentials, it generates a URL of the form:

http://api.temasys.com.sg/api/8b787551-1cf7-43e3-a1fa-90d2f9444014/1/2015-07-09T12:18:23.0Z/100000.000000?cred=q8B1vimCZflsMWzQ3QqaQDYpI68%3D

Which is incorrect, the "duration" value is written as a double when the URL is created. This yields the response:

{
  "success": false,
  "error": 4005,
  "info": "The credentials is not matched for the apiKey . Please go to developer.temasys.com.sg to manage your api keys."
}

The issue can be fixed manually for each URL by removing the fractional part of the "duration" as shown below:

http://api.temasys.com.sg/api/8b787551-1cf7-43e3-a1fa-90d2f9444014/1/2015-07-09T12:18:23.0Z/100000?cred=q8B1vimCZflsMWzQ3QqaQDYpI68%3D

The above URLs can be verified using curl. Though since this behaviour is part of the SDK and out of our control we can't fix it ourselves.

I hope this issue will be fixed in short since it currently prevents us from using this lib.

How to set UserInfo for every connection

As title

I tried to use sendUser to update a connection and getUserInfo to print out the userInfo I just send, but all I get is nil, can somebody help?

my code is like this:

    var config = SKYLINKConnectionConfig()
    config.audio = true;
    config.video = true;
    var chat : SKYLINKConnection?
    chat = SKYLINKConnection.init(config: config, appKey: MYAPPKEY)
    
    chat?.lifeCycleDelegate = self
    chat?.mediaDelegate = self
    chat?.remotePeerDelegate = self

    SKYLINKConnection.setVerbose(true)
    var dic: NSDictionary = ["NickName": "123456"]
    chat?.connectToRoom(withSecret: "iv4gws9a0l1h5", roomName: "123", userInfo: dic)

and I set up a button, which after pressed will execute following

    chat?.sendUserInfo(dic)
    if let id = chat?.myPeerId
    {
         let user = chat!.getUserInfo(id) as? NSDictionary
         print("userInfo: \(user)")
    }

when I tried to print user, it's always nil

Very bad quality, hickups and high latency

Hello,

We've been developing our app around this SDK for months and have never had a single smooth experience. The video quality is very bad, low resolution, constantly getting stuck and with very high latency.

It takes about 5-10 seconds to connect (not really a problem). I THINK it is using STUN (local IP addresses are mentioned in the logs), but the logs are very hard to understand with many unnecessary details (why can't it just print a summary of the successful connection?).

How can I change the resolution?
And the bandwidth?
Both of these seem to be very low, the bandwidth possibly low enough to even be the root cause of all issues mentioned here.

We've tested our app on 100MBit/s fiber connections, 3G, 4G, and it always performs badly. This feels like a problem on your end, if not then please provide me with step-by-step instructions on how to debug and solve this issue.

Patch for XCode 9 + Auto Swift Library Setting and Symbol Stripping for App Store

For this to work on XCode 9 a more up to date version of Starscream is required (default is 2.x and this can only be upgraded on XCode 8. This change to the Podfile fixes that error, as well as a couple of other must have post install hooks that get rid of the default Swift 3.3 error and remove debug symbols that cause errors uploading to App store

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'SkylinkSample' do
pod "SKYLINK"
pod "UIAlertView-Blocks"
pod "Starscream"
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.1'
            config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
        end
    end
end

Wrong speaker used

On an iPhone 5s, the incoming audio is played back using the wrong speaker (as if the device was held up during a phone call). Setting the audio session category to AVAudioSessionCategoryPlayAndRecord causes this on some devices. The workaround is to use AVAudioSession's overrideOutputAudioPort (AVAudioSessionPortOverride.Speaker). This probably needs to be done inside the SDK itself (actualy every time the audio session category is changed) and preferably exposed as an API to control the behaviour.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.