IOS can't answer when call func"- (void)answer:(SKWMediaStream *)stream;" in action touch button

83 views
Skip to first unread message

ky...@altplus.com.vn

unread,
Nov 29, 2016, 9:38:20 PM11/29/16
to SkyWay Technical Forum
Dear all! 
i have problem with my application. 

1. On AppDeletage i create SkywayPeer and set callBacl 
2. When have event call: => open new screen sample: 

[peer on:SKW_PEER_EVENT_CALL callback:^(NSObject* obj) {

        if (YES == [obj isKindOfClass:[SKWMediaConnection class]]) {

            wSelf.mediaConnection = (SKWMediaConnection *)obj;

            

            wSelf.callingView = [[MediaConnectionViewController alloc]initWithNibName:@"MediaConnectionViewController" bundle:nil];

            wSelf.callingView.view.frame = [[UIScreen mainScreen] bounds];

            wSelf.window.rootViewController = wSelf.callingView;

            [wSelf.window makeKeyAndVisible];

            

        }

    }];


3. in MediaConnectionViewController when i call answer func in viewDidLoad => ok example 

- (void)viewDidLoad {

    [super viewDidLoad];    

    [self getLocalStream];

    [self setMediaCallbacks:APP_DELEGATE.mediaConnection];

    [APP_DELEGATE.mediaConnection answer:_msLocal];

}


but i have button answer and call 3 func on action button click, it's  not working to answer. 

- (IBAction)answerButtonClick:(id)sender {

    [self getLocalStream];

    [self setMediaCallbacks:APP_DELEGATE.mediaConnection];

    [APP_DELEGATE.mediaConnection answer:_msLocal];

}


pls help me, thank U 






Tsuyoshi Takahashi

unread,
Dec 7, 2016, 7:48:47 PM12/7/16
to SkyWay Technical Forum
Hi, this is SkyWay Development team.

When you call MediaConnection#answer outside Peer#on(CALL) event , it doesn't work.
It’s a restriction of our SDK.

So, for example, you can use a DataConnection before calling over a MediaConnection.
An example flow is as follows.

(#A wants to call to #B)

#A establishes a DataConnection with #B.
#A sends some kind of an indication of call-attempt to #B over the DataConnection.
#B alerts the user of #B (pop-up etc), then the user selects "Answer" or "Decline".
#B sends the above selection result to #A over the DataConnection.
#A calls MediaConnection#call() if the selection of #B(No.3,4) is "Answer".
#B calls MediaConnection#answer() in Peer#on(CALL) callback


Best Regards,
Reply all
Reply to author
Forward
0 new messages